Introduction
The TRADE360 is a system that works as a “delta update mode” product for markets/settlements and “full update mode” for fixtures/livescore, it means that the customer is supposed to be connected to the RabbitMQ updates without any disconnection/issues/bugs. As we all know, it’s impossible in the programming world especially when we talking about the “between” services communication (in our case RabbitMQ is a TCP-based communication)
Therefore, we have created the Snapshot API. This API will return to you all the latest messages that were sent to the customer’s RabbitMQ Queue. No matter if the customer is subscribed to that queue and received the messages, It will be part of the Snapshot API response.
In that way, we are making sure that the customer is fully updated even if any issue occurred.
The correct workflow:
To fully recover correctly from any connectivity issue that you experienced, you will need to perform the following steps:
1. Start to listen to your RabbitMQ queue - don’t process the messages before the second step is done.
2. Request the latest snapshot from the Snapshot API - please take a look at the cases segment for your next steps after sending the snapshot API request.
After step 2 processing is finished, Please start to process all the messages that you have received from the RabbitMQ.
The synchronization mechanism of the snapshot and the RabbitMQ updates are supposed to be working according to the bets last update values. (There is a possibility that the RabbitMQ update will be outdated compared to the snapshot update).
It’s very important to store the received messages in the process memory or other internal/external cache solutions and not to leave the messages in the Queue.
Your queue is limited to holding 10K messages at the top. After that number is reached your distribution will turn off automatically and you will have to reconnect again and do the whole processing again.
That can cause your service to be in an infinite loop.
Cases where you will need to send snapshot API request:
There are 2 reasons to send the snapshot API request:
1. Disconnection from the RabbitMQ - no matter what is the reason, if you lost some updates your feed is probably outdated.
For this type of problem, you probably will have to send a full snapshot request but it’s strongly recommended to filter the request according to the relevant timestamps (for more information please read the documentation)
2. Message Sequence inconsistency for market updates - If the number of the Message Sequence that you received is not successive (always increased by one), you probably missed some messages.
If the inconsistency appears for Livescore/Fixture update it is not a crucial issue because all the updates are snapshots.
But if the case is with markets/settlements you will need to send a snapshot request for the specific problem. Please read the snapshot documentation. (In most cases you wouldn’t have to send a full snapshot request!)
Documentations:
InPlay Snapshot
PreMatch Snapshot
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article