Post validation with Spring AMQP

Is there any way to confirm to the publisher that the posted message was delivered to the listener when using Spring AQMP? I have a number of queues that I set up x-message-ttl = 0

which means messages will be discarded if they cannot be delivered immediately, but since I am using this in a request / response script I would like to be able to abort the request and handle the error immediately.


source to share

1 answer

You can post a message with mandatory


If this flag is set, the server will return an invalid message with a return method. If this flag is zero, the server will be queued but with no guarantee that it will ever be consumed.

And set a callback that will be called if the message cannot be canceled.

Another solution should be to use an alternative exchange associated with your exchange. The disadvantages are that you need to bind a queue to this AE and use messages to see if the request has failed.



All Articles