File-Based Session Storage keeps incoming and outgoing messages and session's state data in files in the OnixS::B3::BOE::SessionSettings::storageDirectory folder.
For each FIXP session the following files are created:
SESSION_NAME.state
contains session state data (OnixS::B3::BOE::Session::sessionVerId, OnixS::B3::BOE::Session::negotiated, OnixS::B3::BOE::Session::inSeqNum, OnixS::B3::BOE::Session::outSeqNum, etc.).SESSION_NAME.summary
contains Base64 encoded binary SBE messages. To decode these messages, use the SBE Log Decoder Sample from the Handler distribution package.SESSION_NAME
is formed on the base of OnixS::B3::BOE::Session::id, OnixS::B3::BOE::SessionSettings::enteringFirm and a timestamp. It is available via the OnixS::B3::BOE::Session::storageId method.
Sometimes it is needed to save space on disk, and there is no need to keep the whole history of incoming and outgoing messages. File-Based Storage could be configured to store messages in a set of .summary
files, instead of a single one. The entire collection of logged messages is split through several files called "segments", and older segments could be archived.
The Segmented mode of the File-based Storage is activated when the OnixS::B3::BOE::SessionSettings::fileBasedStorageSegmentSize(Messaging::UInt64 value) is set to a positive value.
Segments are named as StorageID[-part-N].summary
, where:
StorageID
- the generic ID of storage (available via the OnixS::B3::BOE::Session::storageId method);-part-N
- the segment suffix. The N
is the 1-based number of segments. One segment does not have this suffixDuring the session lifetime, new segment files are created per the following algorithm:
StorageID.summary
file;StorageID.summary
file size is compared toStorageID.summary
to StorageID-part-N.summary
and creates a new empty StorageID.summary
file to store subsequent messages.N
is a sequential number of parts starting from 1
.So during a long session, a set of files could be created: StorageID.summary
, StorageID-part-1.summary
, StorageID-part-2.summary
, etc. Oldest messages are stored in the StorageID-part-1.summary
file, and newer ones - in the StorageID.summary
and StorageID-part-N.summary
files, where N
is the maximum value.
The number of segments is recorded in the StorageID.state
file after the FilePartCount
key. For instance, if there are 5
segments, (StorageID.summary
, StorageID-part-1.summary
, ... , StorageID-part-4.summary
) the following line will be stored in the StorageID.state
file:
FilePartCount=5