How to post data for multiple symbols?

Bharathvaj1207
Bharathvaj1207 Newcomer
edited August 28 in WebSocket API

Hello,

https://github.com/Refinitiv/websocket-api/blob/master/Applications/Examples/java/MarketPricePosting.java

We have made use of the above example to update data for symbols in WebSocket API. Please note that the above example does not explain/demonstrate the steps to update data for multiple symbols and we have been told that only 1 symbol can be updated using a single post message.

We have a requirement to update data for many symbols and we have tailored the above example to run in a loop to send data for multiple symbols one after another. Also we have made the system to wait 0.4 seconds to acquire the acknowledgement receipt for each symbol that has been updated in WebSocket API.

Because of this approach, it takes around 11 minutes to update data for 700+ symbols.

We would like to know if there is any other approach to do it effectivety such as updating data for multiple symbols in a single post message and acknowledgement receipt for each symbol should also be received.

Thanks.

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @Bharathvaj1207

    Thank you for reaching out to us.

    Each post message supports only one RIC.

    However, you can send an array of post messages via a websocket connection. For example:

    [
    {
    "Ack": true,
    "ID": 1,
    "Key": {
    "Name": "TEST01",
    "Service": "DIST_CACHE"
    },
    "Message": {
    "Fields": {
    "ASK": 452.60,
    "PRIMACT_1": 451.3,
    "SEC_ACT_1": 451.3,
    "BID": 452.55
    },
    "ID": 0,
    "Type": "Update"
    },
    "PostID": 10,
    "Type": "Post"
    },
    {
    "Ack": true,
    "ID": 1,
    "Key": {
    "Name": "TEST02",
    "Service": "DIST_CACHE"
    },
    "Message": {
    "Fields": {
    "ASK": 452.60,
    "PRIMACT_1": 451.3,
    "SEC_ACT_1": 451.3,
    "BID": 452.55
    },
    "ID": 0,
    "Type": "Update"
    },
    "PostID": 12,
    "Type": "Post"
    }
    ]
    image.png

Answers

  • Bharathvaj1207
    Bharathvaj1207 Newcomer
    edited August 29

    Hello @Jirapongse,

    Much thanks for the response. It did help to post data for multiple symbols. Initially i tried to post data for 50 symbols using arrays of post messages and it is working fine.

    However, I would like to know if we have any limitation on sending array of post messages. Will the WebSocket be able to handle if i send array of post messages containing 700+ symbols ?

    Also, is there a way to get the exact time at which the symbol is updated in Websocket using acknowledge messages ?

    Thanks.