Thread: [Quickfix-developers] order of tags
Brought to you by:
orenmnero
|
From: Alvin W. <AW...@FF...> - 2005-12-05 22:06:56
|
Hi
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, how
can I guarantee that all the tags belong to the same component block (such
as Instrument component block) are put together in a message?
Thanks
Alvin
**********************************************************************
This e-mail message is intended solely for the use of the addressee.
The message may contain information that is privileged and confidential.
Disclosure to anyone other than the intended recipient is
prohibited. If you are not the intended recipient, please do not
disseminate, distribute or copy this communication, by e-mail or
otherwise. Instead, please notify us immediately by return e-mail
(including the original message with your reply) and then delete
and discard all copies of the message. We have taken precautions to
minimize the risk of transmitting software viruses but nevertheless
advise you to carry out your own virus checks on any attachment to
this message. We accept no liability for any loss or damage caused
by software viruses.
**********************************************************************
|
|
From: Dave L. <dav...@ma...> - 2005-12-05 22:42:45
|
Hi Alvin,
As far as I understand, the default ordering of tags is numeric, i.e. lowest
tag number first and highest last. The header and trailer are slightly
different, in that the header must start with tag 8, 9 and 35, and the
trailer must end with tag 10, but otherwise tags are ordered numerically.
With repeating groups order is more important and hence there is a
constructor that allows you to specify a message order, e.g.:
Group( int field, int delim, const int order[] )
...where order[] specifies the tag sort order.
The ordering seems to be implemented in FieldMap, a base class used for the
various message parts.
Oren, Are there any thoughts on providing a similar constructor in the
message class?
Dave
On 6/12/05 5:31 am, "Alvin Wang" <AW...@FF...> wrote:
> Hi
>
> 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, how can I
> guarantee that all the tags belong to the same component block (such as
> Instrument component block) are put together in a message?
>
> Thanks
>
> Alvin **********************************************************************
> This e-mail message is intended solely for the use of the addressee. The
> message may contain information that is privileged and confidential.
> Disclosure to anyone other than the intended recipient is prohibited. If you
> are not the intended recipient, please do not disseminate, distribute or copy
> this communication, by e-mail or otherwise. Instead, please notify us
> immediately by return e-mail (including the original message with your reply)
> and then delete and discard all copies of the message. We have taken
> precautions to minimize the risk of transmitting software viruses but
> nevertheless advise you to carry out your own virus checks on any attachment
> to this message. We accept no liability for any loss or damage caused by
> software viruses.
> **********************************************************************
|
|
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 |