1

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?.

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
mahlatse
  • 11
  • 3

1 Answers1

0

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.

dsolimano
  • 8,870
  • 3
  • 48
  • 63
  • thanks for the reply, I have since sent the file back to the client as I also read the fix4.4 draft, [fix-44 draft2 VOL-1.doc](https://secure.fia.org/downloads/Standards/fix-44_draft2_VOL-1.doc) which explains component messages : _Many of the FIX Application Messages are composed of common "building blocks" or sets of data fields...the FIX specification specifies several key component blocks below which are simply referenced by component name within each Application Message which uses them._ – mahlatse Aug 07 '15 at 05:30