This page sets out the key aspects of establishing and managing sessions between a Whisperer Enterprise Client and a Feed HandlerGateway.
Logon
A FIX session is only fully established when the following stages are complete:
- Establishing a connection (typically, but not always, involving the creation of a TCP socket connection)Socket connection established by the client to Whisperer Enterprise.
- Authentication: Implemented via the exchange of FIX Logon messages.
- Synchronization: Identification of lost/untransmitted messages and retransmission as necessary by either or both sides,
- Verification: Exchange of TestRequest and Heartbeat messages to explicitly confirm correct session establishment.
...
| Tip |
|---|
| In this event, the Customer should contact MF Support Contact in order to confirm the validity of the specified credentials. |
...
Otherwise the Logon Service will hand off the connection to the target Feed HandlerGateway. From this point on, the Client is communicating directly with the Feed Handler the Gateway itself, neither the LogonService, nor any other processes are involved.
...
All Whisperer Enterprise messages are exchanged over TCP, with connectivity maintained directly between the Client and FH and Gateway - so message delivery and ordering are both guaranteed, whilst the socket connection is operating correctly.
...
| Info |
|---|
| title | Previously Sent Messages |
|---|
|
The MF FH Gateway guarantees persistence of sent outbound messages for possible resend for a minimum period of three heartbeat intervals, allowing for detection of dead connections as per Session Monitoring, below. |
...
| Info |
|---|
|
Any unsent messages will be persisted indefinitely until either: - End of Trading Week reset, or
- Client Logon with
ResetSeqNumFlag = FALSE or unset, and subsequent User Session Synchronisation. - Client Logon with
ResetSeqNumFlag = TRUE. This flag may be used at Client discretion, but is recommended for UAT or PROD Pricing sessions only.
|
The table below specifies what messages are to be persisted and resent when necessary, as opposed to being gap-filled.
It will be noted that that all messages that represent stateful events are persisted and resent by the MF Gateway - but only these. It is the responsibility of the Client application to determine the appropriate response.
For sequence gaps identified on the outbound Client Session, it is the responsibility of the Client application to determine which Optional message types are indeed to be persisted for possible resend. This is typically most important for Maker clients accepting or rejecting orders against Taker Venues, but other scenarios may need to be considered.
Resent messages are always characterised by:
- Msg.messageHeader.msgSeqNum populated with the original sequence number
- Msg.messageHeader.sendingTime populated with the resend time
- Msg.TradingFlags.PossDupFlag = TRUE
- Msg.OrigSendingTime populated with Msg.messageHeader.sendingTime of original message
| Warning |
|---|
| Any message that the Client does resend may be forwarded to the Venue, so it is essential be aware of the impact that this may have. |
| Table Filter |
|---|
| inverse | false,false |
|---|
| default | , |
|---|
| cell-width | 150,150 |
|---|
| userfilter | Sent By,Persisted |
|---|
| datepattern | yy-mm-dd |
|---|
| id | 1571392653103_486306577 |
|---|
| labels | Sent By‚Persisted |
|---|
| order | 0,1 |
|---|
|
| Message | Sent By | Received By | Persisted |
|---|
| Logon | Client (Both) |
|
...
...
| Gateway | Client (Both) | No | | Logout | Client (Both) |
|
...
...
| Gateway | Client (Both) | No | | SequenceResetGapFill | Client (Both) |
|
...
...
| Gateway | Client (Both) | No | | Heartbeat | Client (Both) |
|
...
...
| Gateway | Client (Both) | No | | TestRequest | Client (Both) |
|
...
...
| Gateway | Client (Both) | No | | SecurityStatus |
|
...
| Gateway | Client (TAKER) | No | | UserRequest | Client (Both) |
|
...
| Gateway | No | | UserNotification |
|
...
| Gateway | Client (Both) | No | | ErrorReport |
|
...
| Gateway | Client (Both) | Yes | | BusinessMessageReject | Gateway |
|
...
| Client (Both) | Yes | | MarketDataRequest | Client ( |
|
...
...
| Gateway | No | | MarketDataRequestReject |
|
...
| Gateway | Client (Both) | No | | MarketDataIncrementalRefresh |
|
...
| Gateway | Client (Both) | No | | QuoteRequest | Client (TAKER) |
|
...
...
| Gateway | Client (MAKER) | Yes | | Quote | Client (MAKER) |
|
...
...
| Gateway | Client (TAKER) | No | | MassQuote | Client (MAKER) |
|
...
| Gateway | No | | Gateway | Client (TAKER) | No | | QuoteCancel | Client (MAKER) | Gateway | No |
|
...
| Gateway | Client (TAKER) | No | | QuoteResponse | Client (MAKER) |
|
...
...
| Gateway | Client (TAKER) | Yes | | Client (TAKER) |
|
...
...
| Gateway | Client (MAKER) | Yes | | NewOrderMultileg | Client ( |
|
...
...
...
| Gateway | Client (MAKER) | Yes | | OrderCancelReplaceRequest | Client ( |
|
...
...
| Gateway | Optional | | OrderCancelRequest | Client ( |
|
...
...
| Gateway | Optional | | OrderCancelReject |
|
...
...
...
| Gateway | Client (Both) | Yes | | ExecutionReport | Client (MAKER) |
|
...
...
| Gateway | Client (TAKER) | Yes | | ExecutionAck | Client (TAKER) |
|
...
...
It will be noted that that all messages that represent stateful events are persisted and resent by the MF FH - but only these. It is the responsibility of the Client application to determine the appropriate response.
For sequence gaps identified on the outbound Client Session, it is entirely the responsibility of the Client application to determine which message types are to be persisted for possible resend. This is typically most important for Maker clients accepting or rejecting orders against Taker Venues, but other scenarios may need to be considered.
User Session Synchronisation
...
The MFAPI Client initiates a new session with a Logon message - populating NextExpectedMsgSeqNum which contains the next msgSeqNum value that the Client expects to receive from the Whisperer Feed HandlerGateway.
The Whisperer Feed Handler Gateway validates the sequence number value as expected by the MFAPI Client as follows:
If the Client msgSeqNum is lower than the FHGateway's expected value, or the Client is expecting a sequence number higher than the FHGateway's next-to-be-assigned msgSeqNum, then this is an unrecoverable error and the FH Gateway will abort the session with a Logout message (using it's next sequence number).
| Tip |
|---|
| The Customer should contact MF Support Contact to agree the correct resolution actions. |
- Otherwise, the FH the Gateway will issue a LogonResponse message - populating NextExpectedMsgSeqNum which contains the next msgSeqNum value that it expects to receive from the Client.
...
If the Client is expecting a sequence number lower than the FHGateway's next-to-be-assigned msgSeqNum (as used in the preceding Logon response), then the message gap is resolved by the FH the Gateway with SequenceResetGapFill messages and/or the resending of persisted messages as necessary. The preceding LogonResponse will be gap-filled over. A concluding TestRequest will be issued by the Gateway to confirm the end of the replay.
| Warning |
|---|
Should a Client specify a next-expected inbound sequence number too low (e.g. expecting '1' on re-logon just prior to weekly trading session close), then the FH the Gateway will service most of the range to correct with a SequenceResetGapFill. For the more recent messages that are still persisted, these will be processed as normal. The FH The Gateway will not resend a week's worth of persisted messages. Refer to Message Persistence 63805411 above for more detail. |
Resent messages are characterised by:
- Msg.messageHeader.msgSeqNum populated with the original sequence number
- Msg.messageHeader.sendingTime populated with the resend time
- Msg.TradingFlags.PossDupFlag = TRUE
- Msg.OrigSendingTime populated with Msg.messageHeader.sendingTime of original message
- When the MFAPI Client receives the Gateway's LogonResponse message, the Client must behave After any inbound sequence number gaps have been resolved for the MFAPI Client, the Client then reciprocates in a similar manner, based on the the next msgSeqNum value that the Whisperer Feed Handler expects to receive from the Client - as specified in it's LogonResponse.
- The Whisperer Client signals it's completion of session synchronisation with a TestRequest.
On receipt of this TestRequest, the Whisperer Feed Handler will respond with the necessary Heartbeat and then signal it's own completion of session synchronisation with a TestRequest in the opposite direction.
| Note |
|---|
Any new (i.e. not SequenceResetGapFill or resent) messages sent by the MFAPI Client prior to the required Heartbeat response will result in ErrorReport messages. |
- the returned NextExpectedMsgSeqNum value. Any message gap must be resolved by the Client with SequenceResetGapFill messages and/or the resending of persisted messages as necessary. The preceding Logon must be gap-filled over. The Gateway will issue a concluding TestRequest to confirm the end of the replay.
Irrespective of whether repays are required in either direction or not, the Gateway will always issue a further TestRequest to verify overall completion of the session synchronisation. Thus the Client may be expected to respond to one, two or three TestRequest messages in total to successfully Logon.
| Gliffy Diagram |
|---|
| displayName | User Session Synchronziation |
|---|
| name | User Session Synchronziation |
|---|
|
| Warning |
|---|
The Gateway TestRequest messages and Client |
| Warning |
|---|
The mutual exchange of TestRequest and Heartbeat (response) messages are required as verification that no sequence number gaps remain in either direction. The MFAPI Client should only proceed with new messages when these have been processed correctly. Any new messages after it has sent the Heartbeat sent in response to the Whisperer Feed Handler TestRequest. |
| Gliffy Diagram |
|---|
| name | User Session Synchronziation |
|---|
| pagePin | 3 |
|---|
|
(i.e. not SequenceResetGapFill or resent) messages sent by the MFAPI Client prior to the required Heartbeat responses will result in ErrorReport notifications. |
Erroneous Scenarios
Second Logon to Existing Session
...
Should the Client attempt to establish a second (additional) session using the same credentials as of a currently-active Client session, then it will be rejected. The original session will be unaffected.
| Gliffy Diagram |
|---|
| namedisplayName | 4.0 Schema_2ndLogon |
|---|
| name | 4.0 Schema_2ndLogon | pagePin | 1 |
|---|
|
Session Monitoring
Active sessions are monitored at the application level by each party via Heartbeat and TestRequest messages. Indications of problems must result in the monitoring party aborting the session.
...
For inbound Heartbeat and TestRequest messages sent by the Client , the FH the Gateway will allow a fixed maximum allowed message transmission time (MaxTx), currently set to one second, before treating the message as 'missed'. This is used to allow for some degree of hysteresis WRT message delivery latencies.
The Client may specify it's own MaxTx value and logic when monitoring inbound messages sent by the FHGateway.
In both cases only the local clock is used as reference.
...
Once the Client has successfully established a session with the Whisperer Feed Handler Gateway (i.e. on dispatch of the first Heartbeat message in response to the end of synchronisation TestRequest), subsequent Heartbeat messages are sent by each party at the interval as follows:
- The HeartBtInt value is specified by the Client in
...
- their Logon message and subsequently used by both sides of the Client Session, i.e. the Gateway will always use the interval specified by the Client.
- The heartbeat interval timer should be reset after every message is transmitted (not just heartbeats).
- On expiry of the heartbeat interval timer, a Heartbeat message must be sent
...
| Warning |
|---|
| A heartbeat is deemed to have been missed if it is not received within HeartBtInt + MaxTx seconds and must result in the monitoring party issuing a TestRequest. |
info
...
...
MF plans to utilise the Heartbeat message to periodically publish additional metrics to and from the server/Client :
- performance metrics
- additional identification information for human investigators
- Etc.
This functionality will be made available via a backwardly-compatible schema change.
| Gliffy Diagram |
|---|
| displayName | 4.0 Schema_Heartbeat_3 |
|---|
|
| name | 4.0 Schema_Heartbeat_3 |
|---|
| pagePin | 1 |
|---|
|
Test Request
TestRequest messages may be issued by either party and under normal circumstances result in a Heartbeat being sent in response, echoing the specified TestRequestID.
...
| Tip |
|---|
TestRequest messages may be used to obtain an approximate indication of message round-trip times between the MFAPI Client and the Whisperer Feed HandlerGateway. |
| Warning |
|---|
| If no Heartbeat response is received within HeartBtInt + MaxTx seconds of the issuance of the TestRequest, then the party must abort the session with a Logout message. |
| Gliffy Diagram |
|---|
| namedisplayName | 4.0 Schema_TestRequest |
|---|
| name | 4.0 Schema_TestRequest | pagePin | 1 |
|---|
|
Logout
The recipient of a Logout message must echo it with a LogoutResponse (using it's next sequence number).
...
| Warning |
|---|
All messages received by the Whisperer Feed Handler Gateway (from either the Client or the Venue) between the exchange of Logout and LogoutResponse messages will result in ErrorReport messages being sent to the Client. |
ErrorReport
The ErrorReport is a custom, user-defined, message used by the Whisperer Feed Handler to notify the Client when erroneous messages are received:
From Client
- At an invalid lifecycle phase (e.g. QuoteRequest sent before the connection to the Maker Venue is established, or after the Whisperer Feed Handler has disconnected from the Venue).
- Message is not supported by the Venue (e.g. sending a Quote to a Maker Venue).
- Message contains invalid data.
From Venue
- A FIX Reject or BusinessMessageReject message
...