You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue when attempting to parse a TradeCaptureReport (MsgType=AE) message that contains a nested repeating group. The message parses correctly without a data dictionary but fails when the data dictionary is used, suggesting an issue with how the parser validates or iterates through nested groups.
The failure occurs specifically after I introduced the MiscFeesGrp inside the TrdCapRptSideGrp (TradeCaptureReport → TrdCapRptSideGrp → MiscFeesGrp).
Is this a known issue in the quickfix parser, or am I incorrectly structuring the message according to the FIX specification?
Example
The following Go test demonstrates the problem. The assertion for ParseMessageWithDataDictionary() fails, while the assertion for ParseMessage() (without DD) passes.
package main import ( "bytes""testing""github.com/quickfixgo/enum""github.com/quickfixgo/field""github.com/quickfixgo/fix50sp2/tradecapturereport""github.com/quickfixgo/quickfix""github.com/quickfixgo/quickfix/datadictionary""github.com/shopspring/decimal""github.com/stretchr/testify/assert""github.com/stretchr/testify/require" ) funcTestNestedRepeatingGroups(t*testing.T) { tcr:=tradecapturereport.New( field.NewLastQty(decimal.RequireFromString("100"), 2), field.NewLastPx(decimal.RequireFromString("1"), 2), ) tcr.SetTradeRequestID("request-id") tcr.SetTradeID("trade-id") tcr.SetTradeReportID("trade-report-id") tcr.SetFirmTradeID("firm-trade-id") tcr.SetSymbol("AAA/BBB") tcr.SetSecurityID("AAA/BBB") sides:=tradecapturereport.NewNoSidesRepeatingGroup() sideBuy:=sides.Add() sideBuy.SetSide(enum.Side_BUY) sideBuy.SetSideCurrency("AAA") sideBuy.SetSettlCurrAmt(decimal.RequireFromString("100"), 2) // Adding MiscFeesGrp to side buyfees:=tradecapturereport.NewNoMiscFeesRepeatingGroup() fee1:=fees.Add() fee1.SetMiscFeeAmt(decimal.RequireFromString("0.05"), 2) fee1.SetMiscFeeCurr("BBB") fee1.SetMiscFeeType(enum.MiscFeeType_OTHER) fee2:=fees.Add() fee2.SetMiscFeeAmt(decimal.RequireFromString("0.07"), 2) fee2.SetMiscFeeCurr("BBB") fee2.SetMiscFeeType(enum.MiscFeeType_OTHER) sideBuy.SetNoMiscFees(fees) sideSell:=sides.Add() sideSell.SetSide(enum.Side_SELL) sideSell.SetSideCurrency("BBB") sideSell.SetSettlCurrAmt(decimal.RequireFromString("100"), 2) tcr.SetNoSides(sides) // https://github.com/quickfixgo/quickfix/blob/main/spec/FIXT11.xmltransportDict, err:=datadictionary.Parse("spec/FIXT11.xml") require.NoError(t, err) // https://github.com/quickfixgo/quickfix/blob/main/spec/FIX50SP2.xmldataDict, err:=datadictionary.Parse("spec/FIX50SP2.xml") require.NoError(t, err) // Getting the message from the structbytes:=bytes.NewBuffer([]byte(tcr.Message.ToMessage().String())) // Parsing the message USING the data dictionarymsg1:=quickfix.NewMessage() err=quickfix.ParseMessageWithDataDictionary(msg1, bytes, transportDict, dataDict) require.NoError(t, err) // Parsing the message WITHOUT the data dictionarymsg2:=quickfix.NewMessage() err=quickfix.ParseMessage(msg2, bytes) require.NoError(t, err) expectedTags:= []quickfix.Tag{ quickfix.Tag(568), // Tag 568 (TradeRequestID)quickfix.Tag(1003), // Tag 1003 (TradeID)quickfix.Tag(571), // Tag 571 (TradeReportID)quickfix.Tag(1041), // Tag 1041 (FirmTradeID)quickfix.Tag(55), // Tag 55 (Symbol)quickfix.Tag(48), // Tag 48 (SecurityID) } // Assertion failsassert.Subset(t, msg1.Body.Tags(), expectedTags) // Assertion passesassert.Subset(t, msg2.Body.Tags(), expectedTags) }
Detailed Findings
Failure Condition: The parser fails to retain all expected tags when using quickfix.ParseMessageWithDataDictionary.
Trigger: The parsing breaks upon the inclusion of MiscFeesGrp within the side group.
Suspected Location: I put a breakpoint in the library and found that the parsing logic in the following section might be related to how repeating groups are handled, particularly when nested:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context and Problem
Hi team,
I am encountering an issue when attempting to parse a
TradeCaptureReport(MsgType=AE) message that contains a nested repeating group. The message parses correctly without a data dictionary but fails when the data dictionary is used, suggesting an issue with how the parser validates or iterates through nested groups.The failure occurs specifically after I introduced the
MiscFeesGrpinside theTrdCapRptSideGrp(TradeCaptureReport→TrdCapRptSideGrp→MiscFeesGrp).Is this a known issue in the quickfix parser, or am I incorrectly structuring the message according to the FIX specification?
Example
The following Go test demonstrates the problem. The assertion for
ParseMessageWithDataDictionary()fails, while the assertion forParseMessage()(without DD) passes.Detailed Findings
quickfix.ParseMessageWithDataDictionary.MiscFeesGrpwithin the side group.quickfix/message.go
Lines 307 to 372 in e4fe18c
Thank you for your help in advance! Please let me know if you need any other details. 🙏
Beta Was this translation helpful? Give feedback.
All reactions