Candy Smurf
Candy Smurf

Reputation: 31

Spring AMQP sync to asynchronous by time

RabbitMQ Spring AMQP sync to async conversion

I need to convert synchronous message invocation into asynchronous if the request is running too long. If there a way to achieve this by using Spring AMQP client for RabbitMQ? Thanks.

Upvotes: 0

Views: 193

Answers (1)

Gary Russell
Gary Russell

Reputation: 174494

You can hand off to another thread at any time in your code and the container thread will immediately ack the message. But the logic to do the hand off has to be in your listener.

If you want to control the ack, use mode MANUAL and you'll need a SessionAwareMessageListener so you have access to the Channel to do the basicAck.

Upvotes: 0

Related Questions