<div dir="ltr">Hi Team,<div><br></div><div>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 <b>AcknowledgeMode.MANUAL , </b>but am not getting how to set the acknowledgement after processing the message in handleMessage method. Can anyone tell me how to do that?</div>
<div><br></div><div><div><span class="" style="white-space:pre"> </span>SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();</div><div><span class="" style="white-space:pre"> </span>container.setConnectionFactory(connectionFactory());</div>
<div><span class="" style="white-space:pre"> </span>container.setQueueNames(this.reqQueueName);</div><div><span class="" style="white-space:pre"> </span>container.setAcknowledgeMode(AcknowledgeMode.MANUAL);</div><div><span class="" style="white-space:pre"> </span>container.setMessageListener(new MessageListenerAdapter(new SPMessageListener(), jsonMessageConverter()));</div>
</div><div><br></div><div>SPMessageListener.java -<br></div><div><br></div><div>public void handleMessage(String message) {<br></div><div><br></div><div>}<br></div><div><br></div><div>Thanks,</div><div>Sekhar</div></div>