[QFJ-732] Unable to parse messages when the first tag inside the group is another group Created: 05/Mar/13  Updated: 13/May/13  Resolved: 13/May/13

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.5.2
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Srinivas Kirti Teja Rao Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Environment:

java 6, windows


Issue Links:
Duplicate
duplicates QFJ-742 If the first field of a type is a gro... Closed

 Description   

The function parseGroup(String msgType, StringField field, DataDictionary dd, FieldMap parent) in quickfix.Message.java does not consider a case where the first tag in the group is another group.
The code to parse the inner group is in else for a condition to check is that is a first field. Becuase the inner group is the first element, it does not prase the inner group anymore.

if (field.getTag() == firstField) {
if (group != null)

{ parent.addGroupRef(group); }

group = new Group(groupCountTag, firstField, groupDataDictionary.getOrderedFields());
group.setField(field);
firstFieldFound = true;
previousOffset = -1;
} else

{ //there is code here to handle prasing the inner group. }

I looked at the fix specification to see if that is a valid message, having a group as first tag in another group, I think it is allowed. I am using FIX 4.2 spec for this.

The simple but not the best fix is to pull the code out of the else and let is execute for the first field as well.



 Comments   
Comment by Srinivas Kirti Teja Rao [ 05/Mar/13 ]

by "pull the code out of else" i mean the code to parse the inner group out of the else condition.

Comment by Grant Birchmeier [ 05/Mar/13 ]

What is the message that you are trying to parse? Is it a custom message?

I'm not sure if the spec forbids it, but I also don't think the default message/field set has any messages where this occurs.

Comment by Srinivas Kirti Teja Rao [ 05/Mar/13 ]

It is QuoteAcknowledgement message but our customer does not send any other field in NoQuoteSets except for NoQuoteEntries.
Attached is the spec i have to parse the message.

<message name="QuoteAcknowledgement" msgcat="app" msgtype="b">
<field name="QuoteReqID" required="N" />
<field name="QuoteID" required="N" />
<field name="QuoteAckStatus" required="Y" />
<field name="QuoteRejectReason" required="N" />
<field name="QuoteResponseLevel" required="N" />
<field name="TradingSessionID" required="N" />
<field name="Text" required="N" />
<group name="NoQuoteSets" required="N">
<group name="NoQuoteEntries" required="N">
<field name="Symbol" required="N" />
<field name="QuoteEntryID" required="N" />
<field name="SymbolSfx" required="N" />
<field name="SecurityID" required="N" />
<field name="IDSource" required="N" />
<field name="SecurityType" required="N" />
<field name="MaturityMonthYear" required="N" />
<field name="MaturityDay" required="N" />
<field name="PutOrCall" required="N" />
<field name="StrikePrice" required="N" />
<field name="OptAttribute" required="N" />
<field name="ContractMultiplier" required="N" />
<field name="CouponRate" required="N" />
<field name="SecurityExchange" required="N" />
<field name="Issuer" required="N" />
<field name="EncodedIssuerLen" required="N" />
<field name="EncodedIssuer" required="N" />
<field name="SecurityDesc" required="N" />
<field name="EncodedSecurityDescLen" required="N" />
<field name="EncodedSecurityDesc" required="N" />
<field name="QuoteEntryRejectReason" required="N" />
</group>
</group>
</message>

Comment by Srinivas Kirti Teja Rao [ 05/Mar/13 ]

I think you are right, i didnt find with any default message where this occurs but the spec does not forbid it. So it is still a valid message I believe.

Comment by Christoph John [ 05/Mar/13 ]

I think the problem is that the first field of a repeating group is always required to be set since it acts as delimeter. Could be difficult in your case.
And you say that the FIX4.2 spec does not forbid it? There are some version-unspecific cases that are clarified in later FIX specs as well. So it might be worth taking a look at the current FIX spec.
Here are some general points about the NumInGroup field: http://fixwiki.org/fixwiki/NumInGroupDataType
There is also a linked discussion. Maybe it's worth asking there, if your message is a valid one with regard to the spec.

Comment by Srinivas Kirti Teja Rao [ 05/Mar/13 ]

FIX 4.2 spec mandates the first field to be present always. But the first field in my case turned out to be group and it is present always in the message. I didnt find anything that says FIX42 spec forbids this and the above code in parseGroup assumes the first field is not a group.

But yeah, i will try and refer the current fix spec and see if i find any clarifications regarding this.
Thanks for the quick response.

Comment by Srinivas Kirti Teja Rao [ 07/Mar/13 ]

I referred to the FIX spec 5 and found nothing that forbids a group being a first field in another group.
Can you please take a look and confirm if this is a bug in QuickFixJ and the approach i suggested would solve it without any other repercussions?

Comment by Srinivas Kirti Teja Rao [ 07/Mar/13 ]

I have also posted the question on validity of message on FIX general discussion forum (http://fixprotocol.org/discuss/read/0cd64db1)

Comment by Srinivas Kirti Teja Rao [ 08/Mar/13 ]

The response the thread says is it is allowed to have a repeating group as first field in another repeating group. PartyRiskLimitsGrp is an example for this construct. There are also concerns of how 35=b message is modeled in my case but then that is the message structure decided by one of our makers and because FIX does not forbid that message structure I do not have enough justification to go back and tell them it is invalid structure .

Quickfixj as a fix engine i believe should be able to parse these messages. Can we please look at the fixing the problem?

Comment by Christoph John [ 13/May/13 ]

Closed in favour of QFJ-742 which included a tested solution.

Generated at Sat Nov 23 04:21:16 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.