Add deep copy for Messages
Created by: 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?