Skip to content

Add deep copy for Messages #338

@zeeke

Description

@zeeke

Hi,

As far as I know, quickfix.Message objects referred on received messages are created by quickfix.messagePool and pooled for later use. This optimization prevents me to save a Message reference, i.e. in an array.

It would be useful to have a Message deep copy function in order to get an isolated copy of the message. At the moment, the only way I found to achieve this result involve dumping and parsing back the message:

messageCopy := quickfix.NewMessage()
quickfix.ParseMessage(messageCopy, bytes.NewBufferString(originalMessage.String()))

What do you think about it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementMinor improvement request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions