I would like to now if is posible to implement this idea with RabbitMQ and Spring Integration:
- One queue, with capatity for 1 message.
- The consumers will ask for this message, if it exist in the queue, it will be delivered to them, if not, they get an null or an Error.
- This message ( if exist in the queue ) will not be deleted for had been download, only will be deleted when the producer put another new message in the queue.
Best regards!
Something like this:
With the transaction scope we will poll the queue within transaction. With the
setRollbackOnly()
we rallback TX and, therefore, return the message to the queue back.