user
user

Reputation: 173

Remove message from rabbit MQ after limited attempts of requeing

I put records from a file into rabbit mq,read records from queue and call a service.For rejected records,I am sending a negative acknowledgemnt and requeuing with channel.basicNack method.But requirement is that we need to make only some 3 attempts of service call.After that we have to remove the message from the queue rather keep on calling the service again and again.

Upvotes: 0

Views: 1166

Answers (1)

Gary Russell
Gary Russell

Reputation: 174494

On the last attempt, set the requeue argument in basicNack to false.

Upvotes: 1

Related Questions