As part of the development of a middleware, I need to choose between two mechanisms to do asynchronous processing (with the possibility of replaying failure cases) I have as ideas the two following techniques:
Use the MQ queues (during an error, insert a message in the rejection queue and replay it later)
Use a database to store the cases of failure, and turn a batch to replay them later.
The technical environment is Java (jdlk 8 + wildfly + REST web services as a middleware entry point)
Can you orient me by comparing advantages and inconvinients of the two techniques, and if there is a better solution it will be welcome.
Thanks in advance for your help.
In this situation my preference would be option 1. My reasons would be:
Additionally if the REST service is temporarily busy you could always implement a retry mechanism on the initial request to give it a better chance of success and then place on the queue if the retry attempts fail for processing later. Try looking at something like Spring retry