Hi
We have two types of heartbeat:
- Client initiated: op=heartbeat – this is purely for a client to test a connection – you can send this whenever you choose
- Server initiated: this has a rate on the Subscribe / ChangeMessage
- We send one of these in the absence of market activity
See below for an example of a server heartbeat below using a frequency of 1000 ms:
S: {"op":"marketSubscription","id":8,"heartbeatMs":1000,"marketFilter":{"marketIds":["1.324"]},"marketDataFilter":{}}
R: {"op":"status","id":8,"statusCode":"SUCCESS","error":false}
R{"op":"mcm","id":8,"initialClk":"xAeGqeqzBsQHkdq8uQbEB9jygrkG","clk":"AAAAAAAA","conflateMs":0,"heartbeatMs":1000,"pt":1449855400048,"ct":"SUB_IMAGE"}
R: {"op":"mcm","id":8,"clk":"AEYAVAA7","pt":1449855401068,"ct":"HEARTBEAT"}
R: {"op":"mcm","id":8,"clk":"AIEBAJ4BAIEB","pt":1449855402068,"ct":"HEARTBEAT"}
R: {"op":"mcm","id":8,"clk":"AMoBAOMBANMB","pt":1449855403068,"ct":"HEARTBEAT"}
R: {"op":"mcm","id":8,"clk":"AIQCAK4CAJ4C","pt":1449855404068,"ct":"HEARTBEAT"}
The heartbeat itself:
- Always has a clk – which should be stored
- Never contains data.
- Is sent only if no other traffic has been sent to the client in the interval and is set at 5000 millisecond by default.
Comments
0 comments
Article is closed for comments.