[QFJ-153] tags in a specific order in a FIX packet Created: 08/Mar/07  Updated: 10/Apr/07  Resolved: 10/Apr/07

Status: Closed
Project: QuickFIX/J
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Other Priority: Default
Reporter: Cyril Cohen Assignee: Steve Bate
Resolution: Fixed Votes: 0
Labels: None
Environment:

Window / Linux



 Description   

Hello,

I would like to set tags in a FIX packet in a specific order

For instance, in a FIX quote request packet, I need to set the tag38 after the tag303 and quickfixj set it before even if in my source code I set it after:

...
// Instrument
group.set(new Symbol("EUR/USD"));

// Quote request type
group.setInt(303, 2);

// Quote type
group.setInt(537, 2);

// Order Qty
group.setString(38, "1000000");

qr.addGroup(group);
...

Here is the packet it sends: "...146=1 55=EUR/USD 38=1000000 303=2 537=2 ..."
I need to send it like this: "...146=1 55=EUR/USD 303=2 537=2 38=1000000..."

Thank you



 Comments   
Comment by Brad Harvey [ 14/Mar/07 ]

Hi Cyril,

How are you creating the group? The QuoteRequest message class has an inner class - QuoteRequest.NoRelatedSym - that knows what the correct ordering should be. If you just say new Group() it doesn't know.

So I think something like this should work:

QuoteRequest.NoRelatedSym group = new QuoteRequest.NoRelatedSym();

Then set fields as per your example.

Same thing for other groups in other message types - each message type has its own inner classes for groups it contains.

Hope that helps,
Brad.

Generated at Tue Jul 01 08:07:19 UTC 2025 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.