Skip to content

Throttling publish requests

Trimble Event Service uses throttling to limit publishers from making excessive publish requests to Event Service. It protects the server from a considerable load and ensures equitable distribution of its resources. This feature limits the publishing application to push an event at 500 transactions per second (TPS) or requests per second. If the publishing application exceeds the threshold, the requests are throttled and the publisher is blocked for 5 seconds from publishing to that event.

Websocket

If a publisher crosses the threshold, the server sends the client a message stating “Too Many Requests” for the next 5 seconds. Connections are left open for another 2 seconds. During this period, the server won’t process any throttled requests from the client. However, the publisher server can send acknowledgments to clients during this period. After 2 seconds, the server will close the connection associated with the publisher. While closing the throttled connections, the Event Service server will send back the status code 1008 with the message Too Many Requests.

Recommendation

  • When the threshold is reached, the publisher will start receiving a message “Too Many Requests.” During this time, the publisher is recommended to stop publishing.
  • If reconnection fails after exhausting the retry limit, publishers must establish a new connection manually and start publishing.
  • Ensure new connections publish events within the threshold limit to avoid getting blocked consecutively.