Page History
...
| Note |
|---|
|
Versions
There are 3 key schema versions involved in a Replay Session - Replay Service Server, Client, Original/Replayed Message.
| Example Schema Versions | ||||
|---|---|---|---|---|
| Example Scenario | Replay Service | Client | Original/Replayed Mesage | Notes |
| Newer Client | 18654 | 18656 | 18656 | You 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 Client | 18656 | 18654 | 18654 | You 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 Message | 18656 | 18656 | 18212 | The 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 | ||
|---|---|---|
| ||
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);
}
} |
...
Overview
Content Tools