[QFJ-238] No reject sent for message with duplicate field (OpenFIX) Created: 19/Sep/07 Updated: 07/Aug/08 Resolved: 03/Feb/08 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | Engine |
Affects Version/s: | 1.2.1 |
Fix Version/s: | 1.3.2 |
Type: | Bug | Priority: | Default |
Reporter: | Graham Miller | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Attachments: | qfj-238.patch |
Description |
This is a failing OpenFIX certification test. It will test that the FIX engine sends a reject when it receives a message with two of the same field (non-repeating group fields). In this case, it sends a message with OrderQty(38) set twice. Here is what openFIX has to say about the test: ============ Expected flow:
The details of these session-level tests can be found in the FIX 4.3 Specification, Volume 2. This is the message that they send. FIX.4.2:XXX->OPENFIX: |
Comments |
Comment by Graham Miller [ 19/Sep/07 ] |
Sorry, I forgot to mention that quickfix does not send the reject message. Therein lies the bug. |
Comment by Toli Kuznets [ 20/Sep/07 ] |
So this is actually fairly easy to detect - see the attached patch. There was another variation where we can collect all the dupes and then throw the error at the end, showing all the dupes. i chose the first one, but we can easily go back to case 2. Regardless, the behaviour required by OpenFIX certifiation error is much harder to achieve. However, the way this works is that a message comes in to AbstractIoHandler, MessageUtils.parse gets called which calls Message.fromString which will throw an InvalidMessage exception, prints a log error and that's it - this is too low-level a point to send out a session-level reject. The rejects are sent form Session code itself, and we never get to that point. So not sure how to handle this case best - if we throw an exception before we get into Session message processing code, we don't send a reject. If we wait until Session code, we've already lost the dupe. We can, of course, send a reject in the case the message doesn't parse correctly in AbstractIoHandler.messageReceived but i'm not sure of how easy it is to do that since we don't have access to any Session.generateReject code. thoughts? |
Comment by Steve Bate [ 20/Sep/07 ] |
I understand the issues. We probably need to wait until after the 1.3.0 release for this one. I'd like some more time to consider the options. Is that ok with you? |
Comment by Toli Kuznets [ 20/Sep/07 ] |
Yes, i agree, it's too much of a change to introduce right now. It's possible to create a "duplicate fields" list that's part of the parsed message, and only validate that it's empty when the codepath is in Session.next() code. |