<div dir="ltr">However, if you use ackMode=AUTO, the container will take care of your needs - if you throw an exception, the default behavior is to reject (and requeue). If you don't throw an exception, the message will be ack'd.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 8, 2014 at 8:57 AM, Gary Russell <span dir="ltr"><<a href="mailto:grussell@gopivotal.com" target="_blank">grussell@gopivotal.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font face="courier new, monospace">><span style="font-size:13px">public void handleMessage(String message) {</span></font><div style="font-size:13px">
<font face="courier new, monospace">></font></div>
<div style="font-size:13px"><font face="courier new, monospace">>}</font></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-size:13px"><span style="font-family:arial,sans-serif">This is a </span><font face="courier new, monospace">MessageListener</font><font face="arial, sans-serif"> and doesn't have access to the </font><font face="courier new, monospace">Channel</font><font face="arial, sans-serif">.</font></div>
<div class="im">
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">>>Section 3.11 in [1] suggests you are supposed to use Channel#basicAck from RabbitMQ Java client directly.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div style="font-size:13px"><span style="font-family:arial,sans-serif">Right, and to do that, you have to use a </span><font face="courier new, monospace">ChannelAwareMessageListener</font><font face="arial, sans-serif"> that has a different signature...</font></div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div><font face="courier new, monospace">void onMessage(Message message, Channel channel) throws Exception;<br></font></div><div><font face="arial, sans-serif"><br>

</font></div><div><font face="arial, sans-serif"><br></font></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jan 8, 2014 at 6:25 AM, Michael Klishin <span dir="ltr"><<a href="mailto:mklishin@gopivotal.com" target="_blank">mklishin@gopivotal.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 8 Jan 2014, at 14:41, Rajasekhar P <<a href="mailto:sekhar434145@gmail.com" target="_blank">sekhar434145@gmail.com</a>> wrote:<br>


<br>
> 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?<br>


<br>
</div>Section 3.11 in [1] suggests you are supposed to use Channel#basicAck from RabbitMQ Java client<br>
directly.<br>
<br>
1. <a href="http://docs.spring.io/spring-amqp/docs/1.2.1.BUILD-SNAPSHOT/reference/html/amqp.html#d4e329" target="_blank">http://docs.spring.io/spring-amqp/docs/1.2.1.BUILD-SNAPSHOT/reference/html/amqp.html#d4e329</a><br>


<br>
MK<br>
<br>
Software Engineer, Pivotal/RabbitMQ<br>
<br>
<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>