I have a FIX message as a string, and I am creating a message object from this message using QuickFix4J, so that I can send it to the other party.

The DataDictionary that I am using is given to me by the other party.

But when I resolve it with the DD and create the message, many fields especially the ones that are repeating are getting truncated. Basically when a group of field repeats, the final message has only ONE instance of the repeating fields.

This is my original message:

8=FIXT.1.1|9=1288|35=X|34=1163|49=XX|52=20190410-10:27:43|56=XXXXXXXXXXXXXXXXXXXXX|131=XXXXXXXXXXXXXX_2019410_155743|146=1|55=[X/X]|48=58013XXX5|22=1|6360=XXXXXXXX XXXXXXXX|454=1|455=XX58013XXX54|456=4|20200=2|20201=1|20202=6|20203=99.06300000|20204=1111.00|20205=3|20206=XXX2|20201=2|20202=6|20203=0.14400000|20204=2222.00|20205=3|20206=XXX2|460=3|1227=XXXX|29703=XXXX XXXX|167=XXXX|541=20350410|225=20170410|223=0.03500000|106=XXXXXXXXX XXXX XXXXXX XXXX XXX XXXX XXXXX|107=XXX  3.500  3/1/27 X26|873=20170309|54=2|38=188000|64=20190412|15=XXX|126=20190410-10:32:43|60=20190410-10:27:43|663=1|699=9128286X1|761=1|29715=XX9128286X18|29716=4|29717=XXX|29718=0.02625000|29719=20290215|423=6|453=7|448=XXXXXXX1|447=X|452=11|802=1|523=XXXXXXX XXXXXX XX XXX|803=9|448=XXXX|447=X|452=13|448=XXX XXXXXXXXXX 5|447=X|452=13|448=XXXXXX33|447=X|452=17|802=1|523=0355|803=17|448=XXXX|447=X|452=17|448=XXXXXX XXXXXX XXXXXXXXXX (XXX) XXX|447=X|452=17|448=XXXXXXX|447=X|452=13|58=XXXXXX5 (XXXXXXXXXX, XXXXXXX XXXXXX XX XXX)  XXXXXXXX  XXX XX $100,000 XXX 3.500 03/01/27 X26, XXXXXXXXX XXX 2.625 02/29, XXX XX 2 XXXX XXXXX-XXXXXXX , XXXX XXXX.|5625=2|20117=10155743|5961=XXXXXX|5626=3|20012=1 3|5215=X|5627=XXXXXXXXX|5630=XXXXXXX, XXXX|20120=X2X-XXX-XXXX|21031=X|21032=X|20013=0.3|29724=60|22203=XXXX|29741=000X|29742=1000|10=144|

And this is the message after creating the message object:

8=FIXT.1.1|9=262|35=X|34=656|49=XX|52=20190410-10:27:45.566|56=XXXXXXXXXXXXXXXXXXXXX|131=XXXXXXXXXXXXXX_2019410_155743|146=1|55=[X/X]|48=58013XXX5|22=1|6360=XXXXXXXX XXXXXXXX|454=1|455=XX58013XXX54|456=4|20200=2|20201=2|20202=6|20203=99.06300000|20204=1111.00|20205=3|20206=XXX2|10=111|

This is the code with which I am creating the message:

rawMessage = new Message(newmessage, dataDictionary, false);

Session.sendToTarget(rawMessage, sessionID)

Is there a way I can send the message as is without quickfix4j trying to resolve it and hence truncating fields. Unfortunately I can’t share the DD.


I see two issues:

First issue: Your approach is a mistake

rawMessage = new Message(newmessage, dataDictionary, false);
Session.sendToTarget(rawMessage, sessionID)

You can’t do that! The sequence numbers, timestamps, etc are not valid anymore!

Are you creating a naive message replayer? (Why do people keep trying to do that?) It’s not going to work! FIX messages flows have state that you can’t just blindly replay.

If you’re creating a test harness, it needs to be smarter than this. Stop what you’re doing and reconsider your approach.

Second issue: your DD probably has errors

Truncated repeating groups always means a DataDictionary problem. The DD is not matching the message being parsed. One of the following is surely happening:

  • the message has put a field in the group that is not in the DD’s definition for that group
  • the message’s group has fields out of order (compared to the DD’s order)

When parsing a group, the engine will end the group as soon as it sees a field that it does not expect.

The DataDictionary that I am using is given to me by the other party.

Don’t trust it! Counterparties make errors with their own docs, because they don’t actually use them, or because their internal version are newer than what they’ve published.

Start parsing your message manually against the DD that they gave you, and I bet you’ll find the error.


Thank you Grant for your inputs, finally we figured out that the error was that repeating groups were coming out of order:


solved it.