[rabbitmq-discuss] How to handle AcknowledgeMode.MANUAL acknowledgements within handleMessage() method at consumer end?

Rajasekhar P sekhar434145 at gmail.com
Wed Jan 8 10:41:32 GMT 2014


Hi Team,

I want to handle acknowledgements manually, because, if any error occurs
while processing message it should not be deleted from the queue. For this
I have used *AcknowledgeMode.MANUAL , *but am not getting how to set the
acknowledgement after processing the message in handleMessage method. Can
anyone tell me how to do that?

SimpleMessageListenerContainer container = new
SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory());
container.setQueueNames(this.reqQueueName);
container.setAcknowledgeMode(AcknowledgeMode.MANUAL);
container.setMessageListener(new MessageListenerAdapter(new
SPMessageListener(), jsonMessageConverter()));

SPMessageListener.java -

public void handleMessage(String message) {

}

Thanks,
Sekhar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140108/2743c675/attachment.html>


More information about the rabbitmq-discuss mailing list