![]() |
B2BITS FIX Antenna C++ 2.33.0
|
This article describes the FIX-over-FAST connectivity using B2BITS FIX Antenna C++ (tm) library. It is supposed that the user is familiar with B2BITS FIX Session (Engine::Session) class. For more information please refer to Session description, FIX Session Acceptor and FIX Session Initiator.
The FAST protocol (FIX Adapted for STreaming) is a technology standard developed by FIX Protocol Ltd., specifically aimed at optimizing data representation on the network. It is used to support high-throughput, low latency data communications between financial institutions. In particular, it is a technology standard that offers significant compression capabilities for transporting high-volume market data feeds and ultra-low latency applications.
Using B2BITS FIX Antenna C++(tm) the user can establish connection with FIX-over-FAST oriented remote site. Current users are also able to migrate from FIX to FIX-over-FAST without significant code modifications.
The following step-by-step guide will explain how to create FIX-over-FAST session, establish connection and send/receive FIX messages.
In order to send and/or receive application messages, the user should create an instance of the Engine::Session class using the Engine::FixEngine::createSession method with an appropriate value of underlyingProtocolType parameter (see also Session description). The following sample demonstrates the creation of a FIX 5.0 over FIXT 1.1 over FAST session.
The following sample demonstrates how to create FIX 5.0 over FIXT 1.1 over FAST session.
See also: Application description
Then the user should establish connection with a remote counterparty. There are two methods to establish connection:
The following sample demonstrates how to establish a session as the initiator. The server is supposed to be located at localhost and bound to 9999 port.
The following sample demonstrates how to accept an incoming FIX-over-FAST connection.
After the connection is established the user is able to receive application messages. The process method of the Engine::Application class has to be implemented to process incoming messages.
After connection is established the user is able to send application messages. The following sample demonstrates how to create and send a message:
See also: Send message | Send message
Since FAST does not support full range of FIX types, mapping between FAST and FIX types is needed. The table below contains all conversion paths.
FAST type | FIX application type | Comments |
u32 | i32 | Value must be in range [0, 2^31) |
u64 | i64 | Value must be in range [0, 2^63) |
u32 | i64 | Value must be in range [0, 2^32) |
u64 | u32 | |
u32 | u64 | Value must be in range [0, 2^32) |
i32 | u64 | Value must be in range [0, 2^31) |
i32 | i64 | Value must be in range (-2^31, 2^31) |
i64 | i32 | |
u64 | i32 | |
u32 | char | Value must be in range [0, 2^7) |
u64 | Engine::UTCTimestampType | Value is serialized/deserialized to u64 using format yyyyMMddhhmmsszzz (i.e. 2008-01-02 03:04:05.678 will be transferred as 20080102030405678) |
u32 | Engine::LocalMktDateType | Value is serialized/deserialized to u32 using format yyyyMMdd (i.e. 2008-01-02 will be transferred as 20080102) |
u64 | Engine::LocalMktDateType | Value is serialized/deserialized to u64 using format yyyyMMdd (i.e. 2008-01-02 will be transferred as 20080102) |
u32 | Engine::UTCTimeOnlyType | Value is serialized/deserialized to u32 using format hhmmsszzz (i.e. 03:04:05.678 will be transferred as 20080102030405678) |
u64 | Engine::UTCTimeOnlyType | Value is serialized/deserialized to u64 using format hhmmsszzz (i.e. 03:04:05.678 will be transferred as 20080102030405678) |
u32 | Engine::Decimal | Fractional part of decimal value will be truncated. Value must be in range [0, 2^32) |
ascii | Engine::Decimal | |
u64 | Engine::Decimal | Fractional part of decimal value will be truncated. Value must be in range [0, 2^64) |
i32 | Engine::Decimal | Fractional part of decimal value will be truncated. Value must be in range (-2^31, 2^31) |
u32 | ascii | Value of string should be an integer in range [0, 2^32) |
u64 | ascii | Value of string should be an integer in range [0, 2^64) |
i64 | ascii | Value of string should be an integer in range (-2^64, 2^64) |
ascii | bool | The value of '\001' will be interpreted as true; otherwise it will be interpreted as false. |
ascii | char | |
ascii | i32 | |
ascii | i64 | |
i32 | char | |
u64 | Engine::MonthYearType | Value is serialized/deserialized to u64 using format yyMMdd (i.e. 2008-01-00 will be transferred as 080100) |