OnixS C++ CME iLink 3 Binary Order Entry Handler  1.16.1
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 override;
UInt64 uuid() const override;
void uuid(UInt64 value) override;
UInt64 previousUuid() const override;
void previousUuid(UInt64 value) override;
SeqNumber inSeqNum() const override;
void inSeqNum(SeqNumber msgSeqNum) override;
SeqNumber previousSeqNum() const override;
void previousSeqNum(SeqNumber msgSeqNum) override;
SeqNumber outSeqNum() const override;
void outSeqNum(SeqNumber msgSeqNum) override;
bool negotiated() const override;
void negotiated(bool status) override;
Timestamp sessionCreationTime() const override;
void sessionCreationTime(Timestamp) override;
void close(bool doBackup = false) override;
void storeInboundMessage(const SbeMessage& message, SeqNumber msgSeqNum, Timestamp messageReceivingUtcTimestamp = Timestamp()) override;
void storeOutboundMessage(const SbeMessage& message, SeqNumber msgSeqNum, Timestamp messageSendingUtcTimestamp = Timestamp()) override;
void flush() override;
void warmup(size_t messageSize, Timestamp ts) override;
void pluggableStorage()
SessionSettings sessionSettings;
int MarketSegmentId = 0;
MySessionStorage myStorage;
Session session(sessionSettings, MarketSegmentId, nullptr, SessionStorageType::Pluggable, &myStorage);
See also
Pluggable Storage Sample.