Websocket API returns the same instrument twice in a single JSON response

  1. All the updates we see come down with the
    "Unspecified" Update type. Is this to do with the trial free
    data?
  2. There are situations where two or more updates are
    part of the same json message. See below for an example in GBP=. The first line
    represents 99% of the updates, a single record. However in a smaller number of
    cases more updates for the same instrument are transported by a single json
    message. How should we interpret the situation when two or more updates for the
    same RIC are collapsed in the same json object? Does one precede the
    other?

2019-05-07 13:17:08.550 DEBUG

[  {  "ID": 6,  "Type": "Update",  "UpdateType":
"Unspecified", "DoNotConflate": true, "Key": { "Service":
"ELEKTRON_DD", "Name": "GBP=" }, "SeqNumber": 39086, "Fields": { "BID": 1.3046, "ASK": 1.305 } }]

2019-05-07 13:17:09.242 DEBUG

[  {  "ID": 6,  "Type": "Update",  "UpdateType":
"Unspecified", "DoNotConflate": true, "Key": { "Service":
"ELEKTRON_DD", "Name": "GBP=" }, "SeqNumber": 39150, "Fields": { "BID": 1.3047, "ASK": 1.3048 } }, { "ID": 6, "Type": "Update", "UpdateType":
"Unspecified", "DoNotConflate": true, "Key": { "Service":
"ELEKTRON_DD", "Name": "GBP=" }, "SeqNumber": 39214, "Fields": { "BID": 1.3047, "ASK": 1.3048 } } }

Best Answer

  • umer.nalla
    Answer ✓

    Hi @erol.komac

    You would treat it the same as you would when you receive two update messages in separate payloads. Process the first and then process the 2nd e.g. in your example above, you have Seqnum 39150 followed by Seqnum 39214

    If you decide to discard the 1st message, how can you be sure that the 2nd contains the same fields with the updated values? You have start comparing fields in the 1st message with fields in the 2nd message - to ensure they both contain the same fields...

Answers

  • Hi @erol.komac

    If you refer to the ADS Install guide you will note there is a wsMsgPacking parameter which defaults to True.

    In summary the parameter determines if multiple message can be packed into a single message - determined by the flushInterval parameter (and maximum message size). This allows the ADS to improve bandwidth and performance - but can be disabled if lower latency is required.

  • Hi @Umer Nalla,

    This one is related to ERT in Cloud (AWS) so i can't make changes on ADS level. A customer trialing the feed came with this query.

    How should we interpret the situation when two or more updates for the same RIC are collapsed in the same json object? Does one precede the other?

    Ideally we get a single message as in this particular case the same instrument is populated twice in the same message and the as same fields are populated, basically the first one is outdated?

  • Yes, makes sense for other asset classes not for fx as bid/ask are always changing at the same time. Thank you for the clarification!!

  • Yes, makes sense for other asset classes not for fx as bid/ask are always changing at the same time. Thank you for the clarification!!

  • I am not a content expert so cannot comment on the behaviour of FX instruments compared to other asset classes.

  • Hi,

    Can someone please answer the first question here? Facing the same issue about UpdateType being Unspecified a lot in the response.

  • Hi @bansalshah

    Please see this reply which covers the same type of question