The system am working on relies on the response received from an external API, frequently now, the requests we are sending finish with a timeout and we end up losing the transaction in progress.

We need our requests to be resent over and over until the API responds so we could continue the transaction.

I got advised to use RabbitMQ so that it queues the requests until the API responds, so this way my application should be a producer that pushes to the queue, what I still can't undrestand is how I am going to receive a callback from the queue once my message (request is excuted sucessfully) ? Does RabbitMQ guarantee that my request reached its destination sucessfully? will it keep trying to send the request until the api responds (the api is available for exchanges) ? How will my application resume the execution related to the request ? my intial idea now is to isolate that code that relies on the immediate response of the external API.

Is it even RabbitMQ the best choice here ?

I have zero experience with RabbitMQ that's why I am still skeptical if it's appropriate in this use case so am sorry in advance if some of these questions are completly dumb.

PS: we are keeping track of the timeout data. The API we are connecting to is part of an external system, we have no control over it.

0 Answers