-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParseMessage messes up order of repeating group tags #568
Comments
The problem is on this line. Line 415 in 098031e
write() sorts the tags in the body without taking into account repeating groups. Lines 317 to 326 in 098031e
|
Good catch, the arbitrary use of sort() in the sortedTags is not FIX protocol compliant and removes a key advantage of using the FIX protocol for integrations. That being said, the sort here is just a hard coded hidden rule based on an opinion matching checks imposed by quickfix downstream from here and might be an oversight or lazy man's "quick fix" avoiding the work to validate correctly. The real issue is what sortedTags more than likely should be doing and how quickfix is not supporting an aspect of the FIX protocol, instead just opting to take a heavy hand and sort everything on write. What should be happening here is the sortedTags should be enforcing the repeating group sort order that the server expects in the agreed repeating group template. During integrations of a client to a server the client will format the repeating groups according to the tag order imposed by the server, not just numerical order by default. |
Hi @steelkorbin , I couldn't agree more. Totally understand how this might have slipped through. I mean, if I hadn't called ParseMessage, but instead sent the NOS message directly after it was constructed using |
I'm seeing this type of behavior badly break processing of Fenics and Bloomberg FIX messages. Leading to missing groups or out of order groups that don't validate. |
Thanks for adding the reference to my reported bug. I did not do any changes in the received message and just sent it back to the sender using the same connection and the repeating group tags were missed up. |
@varunbpatil -- is the issue I reported in #622 the same underlying cause as this? I think you've dug a little more. Encountered it in Bloomberg messages as @segfault suggested. |
@varunbpatil I believe this is resolved by changes in https://github.com/quickfixgo/quickfix/releases/tag/v0.9.1 and https://github.com/quickfixgo/quickfix/releases/tag/v0.9.2 . Try 0.9.2 and please re-open issue if that is not the case. |
Same thing using github.com/quickfixgo/quickfix v0.9.2 |
@ackleymi This has not been fixed. Please re-open the issue. The root cause and the minimum reproducible code has been provided above. I don't think issues should be blindly closed just because you think it may have been fixed. |
To any future readers that stumble upon this issue, this is the fix I've been using - b6f77fd |
Thanks [varunbpatil] I confirm that the above works as expected and resolves the issue. |
Steps to reproduce:
msgBytes := nos.ToMessage().Bytes()
.qfMsg := quickfix.ParseMessage(msgBytes)
.qfMsg.Bytes()
. This should be equal tomsgBytes
which it is becauseqfMsg.Bytes()
simply returns therawMessage
field.qfMsg.Build()
- I've made the build() method public to show the bug that happens when I actually try to sendqfMsg
to the counterparty.qfMsg.Build()
is wrong.Here is the code to reproduce the above issue (assuming you point to a quickfix code which has the build() method made public).
Here is the output of running the above code.
You will see that in the second print statement the party ID repeating group tags are (448, 452, 453), but it should have been (453, 458, 452).
The text was updated successfully, but these errors were encountered: