OnixS C++ CME iLink 3 Binary Order Entry Handler  1.13.0
API Documentation
Pluggable Session Storage

Pluggable session storage is the storage implemented by the user.

For example, it could be used to implement High-Availability (HA) Solutions:

One can implement a Pluggable Session Storage that stores data to shared storage. If one server fails and another reserve server activates, the Handler can restore session states from the shared storage.

Such storage should implement the OnixS::CME::iLink3::SessionStorage interface.

Implementing Pluggable Storage

There are a few basic rules that should be applied to the implementation of Pluggable Storage.

Call Order of Pluggable Storage Methods

This section explains how different methods of Pluggable Storage are called in different situations.

Incoming message handling

If the user's code throws an exception on any stage, the session becomes disconnected, and subsequent steps are omitted.

Outgoing message handling


class MySessionStorage : public SessionStorage
const std::string& id() const ONIXS_ILINK3_OVERRIDE;
void uuid(UInt64 value) ONIXS_ILINK3_OVERRIDE;
UInt64 previousUuid() const ONIXS_ILINK3_OVERRIDE;
void previousUuid(UInt64 value) ONIXS_ILINK3_OVERRIDE;
SeqNumber inSeqNum() const ONIXS_ILINK3_OVERRIDE;
void inSeqNum(SeqNumber msgSeqNum) ONIXS_ILINK3_OVERRIDE;
SeqNumber previousSeqNum() const ONIXS_ILINK3_OVERRIDE;
void previousSeqNum(SeqNumber msgSeqNum) ONIXS_ILINK3_OVERRIDE;
SeqNumber outSeqNum() const ONIXS_ILINK3_OVERRIDE;
void outSeqNum(SeqNumber msgSeqNum) ONIXS_ILINK3_OVERRIDE;
bool negotiated() const ONIXS_ILINK3_OVERRIDE;
void negotiated(bool status) ONIXS_ILINK3_OVERRIDE;
Timestamp sessionCreationTime() const ONIXS_ILINK3_OVERRIDE;
void sessionCreationTime(Timestamp) ONIXS_ILINK3_OVERRIDE;
void close(bool doBackup = false) ONIXS_ILINK3_OVERRIDE;
void storeInboundMessage(const SbeMessage& message, SeqNumber msgSeqNum, bool isOriginal, Timestamp messageReceivingUtcTimestamp = Timestamp()) ONIXS_ILINK3_OVERRIDE;
void storeOutboundMessage(const SbeMessage& message, SeqNumber msgSeqNum, bool isOriginal = true, bool warmUp = false, Timestamp messageSendingUtcTimestamp = Timestamp()) ONIXS_ILINK3_OVERRIDE;
void pluggableStorage()
SessionSettings sessionSettings;
int MarketSegmentId = 0;
MySessionStorage myStorage;
Session session(sessionSettings, MarketSegmentId, ONIXS_ILINK3_NULLPTR, SessionStorageType::Pluggable, &myStorage);
See also
the "PluggableStorage" sample from the distribution package.