quickFix 子组解析失败
quickFix subgroup parsing failed
您好,我在捕获 TradeCaptureReport
时无法将 NoPartyIds(443)
组加入我的 NoSides
组
Iterator<Integer> groupIterator= message.groupKeyIterator();
while (groupIterator.hasNext()) {
int num = groupIterator.next();
List<Group> groups = message.getGroups(num);
log.info("Group Number:"+num+", Groups:"+groups);
for (Group groupInLoop : groups) {
quickfix.fix50sp2.TradeCaptureReport.NoSides noSidesGroup = new quickfix.fix50sp2.TradeCaptureReport.NoSides();
noSidesGroup.setFields(groupInLoop);
noSidesGroup.get(side);
noSidesGroup.get(account);
NoPartyIDs noPartyIDs = new NoPartyIDs();
noSidesGroup.get(noPartyIDs);
log.info("side:"+side+", account:"+account+", noPartyIDs:"+noPartyIDs);
Iterator<Integer> noPartyIDsGroupIterator= noSidesGroup.groupKeyIterator();
log.info("noSidesGroup.groupKeyIterator(): "+noSidesGroup.groupKeyIterator());
log.info("noSidesGroup: "+noSidesGroup.toString()+", noSidesGroup.getGroups(453):"+noSidesGroup.getGroups(453));
log.info("noPartyIDsGroupIterator:"+noPartyIDsGroupIterator);
while (noPartyIDsGroupIterator.hasNext()) {
int noPartyIDsNum = noPartyIDsGroupIterator.next();
List<Group> noPartyIDsGroups = noSidesGroup.getGroups(noPartyIDsNum);
log.info("Group Number:"+noPartyIDsNum+", Groups:"+noPartyIDsGroups);
for (Group noPartyIDsGroupInLoop : noPartyIDsGroups) {
quickfix.fix50sp2.TradeCaptureReport.NoSides.NoPartyIDs partyIdGroup = new quickfix.fix50sp2.TradeCaptureReport.NoSides.NoPartyIDs();
partyIdGroup.setFields(noPartyIDsGroupInLoop);
partyIdGroup.get(partyId);
partyIdGroup.get(partyRole);
log.info("partyId:"+partyId+", partyRole:"+partyRole);
}
}
}
我的 noPartyIDsGroupIterator.hasNext()
returns 是空的,什么也没有,但在我的消息中它有字段。
数据字典看起来像:
<message msgcat='app' msgtype='AE' name='TradeCaptureReport'>
<field name='TradeReportID' required='N'/>
<field name='TradeID' required='N'/>
<field name='TradeReportTransType' required='N'/>
<field name='TradeReportType' required='N'/>
<field name='TradeRequestID' required='N'/>
<field name='TrdType' required='N'/>
<field name='ExecType' required='N'/>
<field name='LastRptRequested' required='N'/>
<field name='TradeReportRefID' required='N'/>
<field name='TrdMatchID' required='N'/>
<field name='ExecID' required='N'/>
<field name='SecondaryExecID' required='N'/>
<field name='ExecRestatementReason' required='N'/>
<field name='PreviouslyReported' required='N'/>
<field name='Symbol' required='N'/>
<field name='SecurityID' required='N'/>
<field name='SecurityIDSource' required='N'/>
<field name='LastQty' required='N'/>
<field name='LastPx' required='N'/>
<field name='Currency' required='N'/>
<field name='TradeDate' required='N'/>
<field name='AvgPx' required='N'/>
<field name='TransactTime' required='N'/>
<field name='CopyMsgIndicator' required='N'/>
<component name='TrdCapRptSideGrp' required='N'/>
<component name='TrdInstrmtLegGrp' required='N'/>
<field name='TradingProtectionLimit' required='N'/>
<field name='TradeEventDecription' required='N'/>
</message>
<component name='TrdCapRptSideGrp'>
<group name='NoSides' required='N'>
<field name='Side' required='N'/>
<field name='SideLastQty' required='N'/>
<field name='SideTradeReportID' required='N'/>
<field name='SideCurrency' required='N'/>
<!--<component name='NoPartyIDsGrp' required='N'/>-->
<group name='NoPartyIDs' required='N'>
<field name='PartyID' required='N'/>
<field name='PartyIDSource' required='N'/>
<field name='PartyRole' required='N'/>
</group>
<field name='Account' required='N'/>
<field name='Text' required='N'/>
<field name='OrderID' required='N'/>
<field name='ClOrdID' required='N'/>
<field name='RefOrdIDReason' required='N'/>
<field name='OrdType' required='N'/>
<field name='Price' required='N'/>
<field name='StopPx' required='N'/>
<field name='ExecInst' required='N'/>
<field name='OrdStatus' required='N'/>
<field name='OrderQty' required='N'/>
<field name='LeavesQty' required='N'/>
<field name='CumQty' required='N'/>
<field name='TimeInForce' required='N'/>
<field name='ExpireDate' required='N'/>
<field name='ExpireTime' required='N'/>
</group>
</component>
同样对于 noSidesGroup
内的 noPartyIDs
字段,它给出计数 5,但无法访问此 noPartyIDsgroup 内的元素。
可以通过使用 groupInLoop
作为 noPartyIds
组的迭代器来解析。
Iterator<Integer> noPartyIDsGroupIterator= groupInLoop.groupKeyIterator();
您好,我在捕获 TradeCaptureReport
NoPartyIds(443)
组加入我的 NoSides
组
Iterator<Integer> groupIterator= message.groupKeyIterator();
while (groupIterator.hasNext()) {
int num = groupIterator.next();
List<Group> groups = message.getGroups(num);
log.info("Group Number:"+num+", Groups:"+groups);
for (Group groupInLoop : groups) {
quickfix.fix50sp2.TradeCaptureReport.NoSides noSidesGroup = new quickfix.fix50sp2.TradeCaptureReport.NoSides();
noSidesGroup.setFields(groupInLoop);
noSidesGroup.get(side);
noSidesGroup.get(account);
NoPartyIDs noPartyIDs = new NoPartyIDs();
noSidesGroup.get(noPartyIDs);
log.info("side:"+side+", account:"+account+", noPartyIDs:"+noPartyIDs);
Iterator<Integer> noPartyIDsGroupIterator= noSidesGroup.groupKeyIterator();
log.info("noSidesGroup.groupKeyIterator(): "+noSidesGroup.groupKeyIterator());
log.info("noSidesGroup: "+noSidesGroup.toString()+", noSidesGroup.getGroups(453):"+noSidesGroup.getGroups(453));
log.info("noPartyIDsGroupIterator:"+noPartyIDsGroupIterator);
while (noPartyIDsGroupIterator.hasNext()) {
int noPartyIDsNum = noPartyIDsGroupIterator.next();
List<Group> noPartyIDsGroups = noSidesGroup.getGroups(noPartyIDsNum);
log.info("Group Number:"+noPartyIDsNum+", Groups:"+noPartyIDsGroups);
for (Group noPartyIDsGroupInLoop : noPartyIDsGroups) {
quickfix.fix50sp2.TradeCaptureReport.NoSides.NoPartyIDs partyIdGroup = new quickfix.fix50sp2.TradeCaptureReport.NoSides.NoPartyIDs();
partyIdGroup.setFields(noPartyIDsGroupInLoop);
partyIdGroup.get(partyId);
partyIdGroup.get(partyRole);
log.info("partyId:"+partyId+", partyRole:"+partyRole);
}
}
}
我的 noPartyIDsGroupIterator.hasNext()
returns 是空的,什么也没有,但在我的消息中它有字段。
数据字典看起来像:
<message msgcat='app' msgtype='AE' name='TradeCaptureReport'>
<field name='TradeReportID' required='N'/>
<field name='TradeID' required='N'/>
<field name='TradeReportTransType' required='N'/>
<field name='TradeReportType' required='N'/>
<field name='TradeRequestID' required='N'/>
<field name='TrdType' required='N'/>
<field name='ExecType' required='N'/>
<field name='LastRptRequested' required='N'/>
<field name='TradeReportRefID' required='N'/>
<field name='TrdMatchID' required='N'/>
<field name='ExecID' required='N'/>
<field name='SecondaryExecID' required='N'/>
<field name='ExecRestatementReason' required='N'/>
<field name='PreviouslyReported' required='N'/>
<field name='Symbol' required='N'/>
<field name='SecurityID' required='N'/>
<field name='SecurityIDSource' required='N'/>
<field name='LastQty' required='N'/>
<field name='LastPx' required='N'/>
<field name='Currency' required='N'/>
<field name='TradeDate' required='N'/>
<field name='AvgPx' required='N'/>
<field name='TransactTime' required='N'/>
<field name='CopyMsgIndicator' required='N'/>
<component name='TrdCapRptSideGrp' required='N'/>
<component name='TrdInstrmtLegGrp' required='N'/>
<field name='TradingProtectionLimit' required='N'/>
<field name='TradeEventDecription' required='N'/>
</message>
<component name='TrdCapRptSideGrp'>
<group name='NoSides' required='N'>
<field name='Side' required='N'/>
<field name='SideLastQty' required='N'/>
<field name='SideTradeReportID' required='N'/>
<field name='SideCurrency' required='N'/>
<!--<component name='NoPartyIDsGrp' required='N'/>-->
<group name='NoPartyIDs' required='N'>
<field name='PartyID' required='N'/>
<field name='PartyIDSource' required='N'/>
<field name='PartyRole' required='N'/>
</group>
<field name='Account' required='N'/>
<field name='Text' required='N'/>
<field name='OrderID' required='N'/>
<field name='ClOrdID' required='N'/>
<field name='RefOrdIDReason' required='N'/>
<field name='OrdType' required='N'/>
<field name='Price' required='N'/>
<field name='StopPx' required='N'/>
<field name='ExecInst' required='N'/>
<field name='OrdStatus' required='N'/>
<field name='OrderQty' required='N'/>
<field name='LeavesQty' required='N'/>
<field name='CumQty' required='N'/>
<field name='TimeInForce' required='N'/>
<field name='ExpireDate' required='N'/>
<field name='ExpireTime' required='N'/>
</group>
</component>
同样对于 noSidesGroup
内的 noPartyIDs
字段,它给出计数 5,但无法访问此 noPartyIDsgroup 内的元素。
可以通过使用 groupInLoop
作为 noPartyIds
组的迭代器来解析。
Iterator<Integer> noPartyIDsGroupIterator= groupInLoop.groupKeyIterator();