Sometimes it is more convenient to work with FIX messages just as sequences of tag=value pairs. For example, an application needs to receive a message, access a few fields, and use the value of these fields to route the message to one of the counterparties (so-called "FIX to FIX routing"). In this scenario, it could be impractical to maintain the FIX Dictionary - especially if messages are received from venues that use different FIX Dictionaries.
To support this scenario, the Engine exposes the Flat FIX Message class.
To receive Flat Messages, set OnixS::FIX::Session::messageMode setting to FlatMessage
. In this mode, the overloaded inbound callbacks with OnixS::FIX::FlatMessage objects are called:
To send Flat Messages, use the corresponding OnixS::FIX::Session::send(OnixS::FIX::FlatMessage*) method.
Class | Advantages | Disadvantages |
---|---|---|
Message | Supports validation. | Fields order is defined by the FIX Dictionary. |
Tag-based field access takes constant time. | FIX Repeating Groups are lost without the complete FIX Dictionary. | |
The message type and FIX protocol version cannot be changed. | ||
FlatMessage | FIX Repeating Groups are always preserved and can be accessed without the corresponding FIX Dictionary. | Tag-based field access requires the finding of the tag offset that takes linear time. |
Keeps the field order. | Does not support validation. | |
Any field can be changed. |