The Lab

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from this space and version 1.3.0

...

Note
  • Currently this service is only available to SBE protocol clients.
  • Message field information can be found in the SBE schema message definition.
  • Only Execution Reports are replayable.
  • Only Execution Reports  sent to the client from the MarketFactory servers are replayable.
  • Supports multiple concurrent connections. 


Versions

There are 3  key schema versions involved in a Replay Session - Replay Service Server, Client, Original/Replayed Message. 


Example Schema Versions
Example ScenarioReplay ServiceClientOriginal/Replayed MesageNotes
Newer Client186541865618656You can often use a client to connect to a replay service running an older schema version. This is true as long as the schema Session messages (i.e. Logon) and the Replay specific messages (i.e. ApplicationMessageRequest) are unchanged/backwards compatible. 
Older Client186561865418654You can often use a client to connect to a replay service running a newer schema version. This is true as long as the schema Session messages (i.e. Logon) and the Replay specific messages (i.e. ApplicationMessageRequest) are unchanged/backwards compatible. 
Older Replayed Message186561865618212The payload of the replayed message (RawMessage field of ReplayedMessage) can be encoded using any schema version - it depends on the version of the gateway your pricing/orders clients are using to generate the original messages. That version might be older or newer than that used by the Replay Service or your Client.

In this example, your Client is using schema version 18656 but the replayed messages are encoded with schema version 18212. To read the ReplayedMessage you will a Decoder from schema version 18654. However to decode the original messages stored as raw bytes in the ReplayedMessage you will need to use Decoders generated using schema 18212 (or compatible).


Client Session Management & Logon

...

Code Block
languagejava
public void onReplayedMessage(MessageHeaderDecoder messageHeader, ReplayedMessageDecoder replayedMessage) {
 
    LOG.info(format("[Replay] Received replayed message [%s %s]", messageHeader, replayedMessage));
 
    final ByteBuffer rawBuffer = ByteBuffer.allocateDirect(16000);
    final UnsafeBuffer raw = new UnsafeBuffer(rawBuffer);
 
    replayedMessage.getRawMessage(raw, 0, replayedMessage.rawMessageLength());
 
    final MessageHeaderDecoder header = new MessageHeaderDecoder().wrap(raw, 0);
    final int msgId = header.templateId();
 
    switch (msgId) {
        case ExecutionReportDecoder.TEMPLATE_ID: {
            final ExecutionReportDecoder erd = new ExecutionReportDecoder().wrap(raw, header.encodedLength(), ExecutionReportDecoder.BLOCK_LENGTHheader.blockLength(), ExecutionReportDecoder.SCHEMA_VERSIONheader.version());
            System.out.println(erd);
            break;
        }
        default: {
            System.out.println("Unhandled message: " + msgId);
        }
    }

...