<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>Issue related to message consumption</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Hi,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">I am implementing Rabbit MQ where in</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">I</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"></FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">have a client in Java that sends out messages to a single Q. There is a consumer (extending DefaultConsumer) that deals with this message, however, when ever</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">I</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"></FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">get an exception in my consumer, it travels up to the Connection level and closes the connection.</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri"> This leads to no other messages being consumed anymore.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">I have a singleton class that initializes a Connection</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> using ConnectionFactory</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Using this connection,</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">I</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> have a Channel that</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">declares an Exchange, declares a Queue and</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">binds</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">the exchange and queue. As per the suggestion in the documentation, since channel is not thread safe,</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">I</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"></FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">have it local to each thread.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">However, during consumption,</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">I</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> face an exception (say NullPointer) which although</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">I</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> am catching it, traveses up</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">to the Connection triggering it to be closed.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Please suggest if there is a better way of managing this.</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><B><SPAN LANG="en-us"></SPAN></B><B><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Trebuchet MS">Regards,</FONT></SPAN></B><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><BR>
</SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><B><SPAN LANG="en-us"></SPAN></B><B><SPAN LANG="en-us"><FONT SIZE=2 FACE="Trebuchet MS">Anand Ved</FONT></SPAN></B><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Trebuchet MS"> |</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><B><SPAN LANG="en-us"></SPAN></B><B><SPAN LANG="en-us"><FONT FACE="Calibri"></FONT></SPAN></B><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><B><SPAN LANG="en-us"></SPAN></B><B><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 FACE="Trebuchet MS">Xoriant Solutions Pvt. Ltd.</FONT></SPAN></B><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><BR>
</SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Trebuchet MS">Winchester, Hiranandani Business Park, Po</FONT><FONT COLOR="#000000" SIZE=2 FACE="Trebuchet MS">wai, Mumbai 400076, INDIA.</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><BR>
</SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Trebuchet MS">Tel: +91 22 30511000 | </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Trebuchet MS">+91 22 3051 1058 (Direct) |</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 FACE="Trebuchet MS">VOIP: + 1 408 834 4495 </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><BR>
</SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Trebuchet MS">Yahoo IM: anandved</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Calibri"> </FONT><FONT COLOR="#000000" SIZE=2 FACE="Trebuchet MS"> |</FONT></SPAN><SPAN LANG="en-us"> </SPAN><A HREF="http://www.xoriant.com/"><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><U></U></SPAN><U><SPAN LANG="en-us"></SPAN></U><U><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Trebuchet MS">http://www.xoriant.com</FONT></SPAN></U><SPAN LANG="en-us"></SPAN></A><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Calibri"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> </FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Arial" SIZE=2 COLOR="#000000">
<IMG SRC="No%20AttachName" alt="Picture (Device Independent Bitmap)"></FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=1 FACE="Georgia">Modern technology, Owes ecology, An apology. ~Alan M. Eddison</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Georgia"> -</FONT></SPAN><SPAN LANG="en-us"><I></I></SPAN><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"></SPAN></I><I><SPAN LANG="en-us"> <FONT COLOR="#00B050" SIZE=5 FACE="Georgia">G</FONT></SPAN></I><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"></SPAN></I><I><SPAN LANG="en-us"><FONT COLOR="#00B050" FACE="Georgia">o</FONT></SPAN></I><SPAN LANG="en-us"><I></I></SPAN><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"></SPAN></I><I><SPAN LANG="en-us"> <FONT COLOR="#00B050" SIZE=5 FACE="Georgia">G</FONT></SPAN></I><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"></SPAN></I><I><SPAN LANG="en-us"><FONT COLOR="#00B050" FACE="Georgia">reen!!</FONT></SPAN></I><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"></SPAN></I></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
</BODY>
</HTML>