Table of Contents |
---|
Description
In earlier versions of FIX Antenna (2.10.14 and earlier) any session object could be uniquely identified by SenderCompId/TargetCompId pair.There were number of methods in external interface of FIX Antenna (like Engine::createSession) which took SenderCompId and TargetCompId parameters to identify session.
...
In this example all sessions except "Sender1/Target1" will pass Session Qualifier as tag 9012 in Logon message.
...
Example
To establish several sessions with the same SenderCompId and TargetCompId, both Initiator and Acceptor should create several session objects which differ from each other by SessionQualifier property.
SessionQualifier property on Initiator side must be the same as SessionQualifier property of the corresponding session on acceptor side.
If you do not want an Initiator to pass the Session Qualifier in Logon message, you need to set the property for the Initiator:
Code Block | ||
---|---|---|
| ||
Engine::SessionExtraParameters params; params.logonMessageSessionQualifierTag_ = 0; |
...
Code Block | ||
---|---|---|
| ||
params.pSenderSubID_ = "YourSenderSubID"; |
Below is the code snippet that demonstrates how to do it.
Code Block | ||
---|---|---|
| ||
namespace { const char Acceptor2Name[] = "Acceptor2"; const char InitiatorName[] = "Initiator"; const char Q1[] = "1"; //Session Qualifier const char Q2[] = "2"; //Session Qualifier const char* LISTENER_IP = "127.0.0.1"; const int LISTENER_PORT = 9026; class InitiatorApp : public Engine::Application { //implementation }; } ... int main() { //init engine Engine::FixEngine::init("engine.properties"); //... Engine::SessionExtraParameters params; params.logonMessageSessionQualifierTag_ = 0; params.pSenderSubID_ = "SenderSubID_1"; // create two initiator sessions corresponding to the registered acceptor sessions and establish connections InitiatorApp app1, app2; Engine::Session* ps1 = Engine::FixEngine::singleton()->createSession( &app1, Engine::SessionId(InitiatorName, Acceptor2Name, Q1), Engine::FIX44, ¶ms); ps1->connect( 30, LISTENER_IP, LISTENER_PORT ); params.pSenderSubID_ = "SenderSubID_2"; Engine::Session* ps2 = Engine::FixEngine::singleton()->createSession( &app2, Engine::SessionId(InitiatorName, Acceptor2Name, Q2), Engine::FIX44, ¶ms); ps2->connect( 30, LISTENER_IP, LISTENER_PORT ); //... } |
As the result of running such code, following Logon messages will be sent:
Session Initiator/Acceptor2/SenderSubID_1:
...