The session's parameter Engine::SessionExtraParameters::keepConnectionState_ means that session will continue use current storage and values of the InSeqNum and OutSeqNum. Otherwize new storage will be created and seqNums will be reset.
For example:
Appl appl; // : see the Application class // Create session Sender:Target that keeps state at switch connection SessionExtraParameters params; params.keepConnectionState_ = true; Engine::Session *sn = Engine::FixEngine::singleton()->createSession(appl, "Sender", "Target", FIX44, ¶ms, persistent_storageType); Engine::SessionBackupParameters backupParams; backupParams.host_ = "localhost"; backupParams.port_ = 5679; backupParams.params_ = NULL; // establish connection with primary connection - localhost:4567 sn->connect(30, "localhost", 4567, Engine::NONE, &backupParams); // wait until connection established appl.waitUntilLogon(); // switch to the backup connection - localhost:5679 sn->switchConnection(); appl.waitUntilLogon();
There are two very important consequences of these rules, which in combination with FIX sequenceing and retransmission make impossible losing message in FIX Antenna:
When session identifies "sequence number too high" problem it sends resend request message asking for retransmission oflost messages. Opposite side resends requested messages with PosDupFlag set to "Y". Session level messages are not resent. To keep sequence numbers consistent during resending the sequence reset is used.
FIX Antnenna automatically resolves gap fill i.e. no manual work is required. However it is possible to intervernt into standard mechanism. The Engine::Application::onResend method is called each time application level message is resent. It is possible to return "false" for those messages, which should not be resent; sequence reset will be sent instead.
1.5.6