<div dir="ltr"><div>You rarely need to access the client API directly with Spring AMQP. See the reference documentation <a href="http://docs.spring.io/spring-amqp/docs/1.3.0.BUILD-SNAPSHOT/reference/html/">http://docs.spring.io/spring-amqp/docs/1.3.0.BUILD-SNAPSHOT/reference/html/</a></div>
<div><br></div>You can do the whole thing in Spring without needing to use the client API; simply inject a RabbitTemplate into your listener call one of its send (or convertAndSend) methods. The template will automatically use the same channel (by default); you can then throw an exception and it will be rejected/requeued,<div>
<br></div><div><font face="courier new, monospace">void onMessage(String Message) {</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> try {</font></div><div>
<font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> } catch (SomeException) {</font></div><div><font face="courier new, monospace"> this.rabbitTemplate.converAndSend(someData);</font></div>
<div><font face="courier new, monospace"> throw SomeRuntimeException();</font></div><div><font face="courier new, monospace"> }</font></div><div><font face="courier new, monospace">}</font></div><div><br></div><div>
For Spring-AMQP specific questions, you can use our forum <a href="http://forum.spring.io/forum/spring-projects/integration/amqp">http://forum.spring.io/forum/spring-projects/integration/amqp</a> or the spring-amqp tag on StackOverflow.</div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 9, 2014 at 6:09 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 class="im"><br>
On 9 Jan 2014, at 15:06, Rajasekhar P <<a href="mailto:sekhar434145@gmail.com">sekhar434145@gmail.com</a>> wrote:<br>
<br>
> Am using spring amqp API, where the error is occurred inside handleMessage() method. Can you please let me know how can we do that?<br>
<br>
</div>Channel#basicPublish.<br>
<br>
Please try to do a little bit of research on the Java client, spring-amqp does not try to completely replace it.<br>
<div class="HOEnZb"><div class="h5"><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">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>
</div></div></blockquote></div><br></div>