For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 2

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?

#technology#productwebsocketsjavarrtoapi-limitscontributions
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @a.karasev

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

@a.karasev

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
79.2k 251 52 74

@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.


1711427732408.png (54.7 KiB)
1711428048765.png (41.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.