Reputation: 11
I am new to the Fix protocol in general, when looking for Fix engines, I was recommened to try quickfix, I have researched some topics and finally managed to generate custom classes, but the project does to compile because some fields are duplicated, this occurs when the main message body defines a tag thats already present in a component, the dictionary that I am using is supplied somewhere and as such I do not have control over it.
<message name="SumMessage" msgtype="X" msgcat="app">
<component name="SumComponent" required="Y" />
<field name="DuplicateField" required="Y" />
</message>
<component name="SumComponent">
<field name="DuplicatedField" required="Y" />
</component>
My question is, since the above has already been defined in the custom component, will it cause the code generation ruby code to create duplicates of the values when creating the message class? If so, does this mean that the dictionary I am using is invalid and I should rather send it back as such?.
Upvotes: 1
Views: 646
Reputation: 8986
That looks like invalid FIX to me
You can't have the same field twice in a message unless you have repeating groups defined, and I see no repeating groups in your spec.
Ask for some example messages to see what they actually want, and you can tweak the spec to match.
Also, you don't necessarily need to regenerate and recompile, if you're willing to forgoe the nice setter and getter functions. For example, message type BN doesn't exist in FIX 4.2, but I have a counterparty that wanted me to send them that message. So I pulled a subset of the definition from a FIX 4.4 spec, put it in my FIX 4.2 spec xml, and did this in code
QuickFix42.Message ack = new QuickFix42.Message(new MsgType("BN"));
ack.setField(new ExecID(execId));
ack.setField(new ExecAckStatus(QuickFix.ExecAckStatus.ACCEPTED));
Session.sendToTarget(ack, session);
And sent that.
Upvotes: 0