I am using QuickFIX/N 1.8 and when it has to create the DataDictionary based on an XML, it fails because my FIX50SP1_TRTN.xml (provided by Thomson Reuters) contains one message (AllocationReport
) with two components (TrdInstrmtLegGrp
, InstrmtLegAllocGrp
), and both components have a group with a same name (NoLegs
- 555
).
QuickFIX/N is trying to create a dictionary per message, containing the groups of all its components, where the key of each group is the id.
Therefore, it's trying to insert the key 555
twice, throwing an Exception the second time.
System.ArgumentException: 'An item with the same key has already been added.'
\QuickFIXn\DataDictionary\DataDictionary.cs
else if(childNode.Name == "group")
{
DDField fld = FieldsByName[childNode.Attributes["name"].Value];
DDGrp grp = new DDGrp();
XmlAttribute req = childNode.Attributes["required"];
if (req != null && req.Value == "Y"
&& (componentRequired == null || componentRequired.Value == true))
{
ddmap.ReqFields.Add(fld.Tag);
grp.Required = true;
}
if (!ddmap.IsField(fld.Tag))
{
ddmap.Fields.Add(fld.Tag, fld);
}
grp.NumFld = fld.Tag;
parseMsgEl(childNode, grp);
ddmap.Groups.Add(fld.Tag, grp); //########### It fails when the second group is processed ###########
}
Summarized content of my FIX50SP1_TRTN.xml
<fix major="5" minor="0">
<header/>
<trailer/>
<messages>
<message name="AllocationReport" msgtype="AS" msgcat="app">
<component name="TrdInstrmtLegGrp" required="N"/>
<component name="InstrmtLegAllocGrp" required="N"/>
</message>
</messages>
<components>
<component name="TrdInstrmtLegGrp">
<group name="NoLegs" required="N"> <!-- 555 -->
(content A)
</group>
</component>
<component name="InstrmtLegAllocGrp">
<group name="NoLegs" required="N">
(content B)
</group>
</component>
</components>
<fields>
<field number="555" name="NoLegs" type="NUMINGROUP"/>
</fields>
</fix>
My questions:
- Is QuickFIX/N supposed to support this situation?
- Have you ever faced this problem? How did you solve it?
- Do you know some explicit constraint (in QuickFIX/N, or the FIX protocol itself) about this situation? (maybe there is an explicit restriction saying that a message cannot contain more than one component with a group with a same name).