WebSocket contribution api limits

Is there a rate limit for websocket contribution API? We send about 500 messages per second but only some updates are visible in the terminal.

In login response we receive {"TRCE:MaxMessagesPerSecond":1000} . Is it the api rate limit? Does it matter if messages equally distributed or we can send all messages (up to the limit) in a fraction of a second?

Best Answer

  • Jirapongse
    Answer ✓

    @a.karasev

    Thank you for reaching out to us.

    If element TRCE:MaxMessagesPerSecond is present in the login response message, it indicates the maximum message posting rate allowed for this application, and should not be exceeded.

    It is the post limitation for the application. However, how fast the server can process the post messages could be another story. You may need to contact the server team via MyRefinitiv for the server processing rates.

    For example:

    I tested two scenarios.

    1. Send 500 post messages at in the for loop every second

                time.sleep(1) 
                if (logged_in):
                    for x in range(500):
    send_market_price_post(ric)

    The value in the PRIMACT_1 field is increased by one for every post.

    The following is the output from the consumer.

    1711427732408.png

    The values in the PRIMACT_1 field retrieved by the consumer are skipped.

    2. Send a post message after sleeping for 2 msec

                time.sleep(0.02) 
                if (logged_in):
                    send_market_price_post(ric)

    The following is the output from the consumer.

    1711428048765.png

    The values in the PRIMACT_1 field look better.

    According to this test, splitting post messages across 1 second provides the better result than posting all messages at once.