Batch request for CSharp RRTO

I used this sample code websocket-api/Applications/Examples/RDP/CSharp/MarketPriceRdpGwAuthenticationExample/ for requesting single stock market price data, it works perfectly. I reviewed the output data with our business product yesterday, they said we need to request not just one stock, it could be 500+ stocks market price. So, that program doesn't work for batch requests.

my questions here:

1. Could you suggest a .net batch version of this program websocket-api/Applications/Examples/RDP/CSharp/MarketPriceRdpGwAuthenticationExample/ ?

2. Is there a limit per batch? How could we implement 500+ stocks requesting data?

Sort by:
1 - 1 of 11

    Hi @Saifullah.Hassan

    There is no specific equivalent .Net batch request example. However, the capability is not much more than creating a list of items within the request. For example:

    {
    "ID": 2,
    "Streaming": true,
    "Key": {
    "Name": ["CAD=","EUR="]
    },
    "View": ["BID","ASK","DSPLY_NAME"]
    }

    There is a limit on the size of the batch. Specifically, the WebSocket streaming services limit the size of a request based on a byte limit returned from the login. For example, within the login response, you will see the limit:

    {
    "ID": 1,
    "Type": "Refresh",
    "Domain": "Login",
    "Key": {
    "Name": "...",
    ...
    },
    ..
    "Elements": {
    "PingTimeout": 30,
    "MaxMsgSize": 61516
    }
    }

    The "MaxMsgSize" defines the size of the total cargo (JSON message) sent. You will need to perform some general calculation to determine the size of the message (in bytes) based on the list of items you plan to send in your batch.

    Alternatively, you can use the Refinitiv Data Library for .Net. This library is built on top of the WebSocket service and provides a lot of value including session and token management, a simple Pricing interface, manages maximum message limits on behalf of the user. I would suggest you refer to the Pricing examples defined within GitHub.

    Here is a simple batch request using the library:

    ahs.png