Re: [Quickfix-developers] order of tags
Brought to you by:
orenmnero
|
From: Caleb E. <cal...@gm...> - 2005-12-05 23:08:47
|
On 12/6/05, Alvin Wang <AW...@ff...> wrote: > > I wonder how the order of tags in a message is determined. It seems that > it is not the same order that code sets the tags. If that is the case, ho= w > can I guarantee that all the tags belong to the same component block (suc= h > as Instrument component block) are put together in a message? > I don't think there is any requirement that tags of a particular component be grouped together. The tag ordering rules as implemented in QuickFIX are as below: - In the header, tags BeginString, BodyLength and MsgType appear first and in that order. Other header fields appear in numeric order. - In the body, fields appear in numeric order except for the case of repeating groups. Fields in a repeating group appear in the order defin= ed by the Data Dictionary. - In the trailer, CheckSum must appear LAST. Other fields (Signature, SignatureLength) appear in numerical order. Here's a quote from the FIX 4.4 spec: Message Format The general format of a FIX message is a standard header followed by the message body fields and terminated with a standard trailer. ** Each message is constructed of a stream of <tag>=3D<value> fields with a field delimiter between fields in the stream. Tags are of data type *TagNu= m. * *All tags must have a value specified. Optional fields without values should simply not be specified in the FIX message. A Reject message is the appropriate response to a tag with no value.* *Except where noted, fields within a message can be defined in any sequence (Relative position of a field within a message is inconsequential.) The exceptions to this rule are:* *1. **General message format is composed of the standard header followed by the body followed by the standard trailer.* *2. **The first three fields in the standard header are BeginString (tag #8) followed by BodyLength (tag #9) followed by MsgType (tag #35).* *3. **The last field in the standard trailer is the CheckSum (tag #10).* *4. **Fields within repeating data groups must be specified in the order that the fields are specified in the message definition within the FI= X specification document. The NoXXX field where XXX is the field being counted specifies the number of repeating group instances that must immediately precede the repeating group contents. * *5. **A tag number (field) should only appear in a message once. If i= t appears more than once in the message it should be considered an error with the specification document. The error should be pointed out to the FIX Global Technical Committee.* -- Caleb Epstein caleb dot epstein at gmail dot com |