Posting it under a modified subject to highlight the area I am trying to focus on.
Currently we notify a Session level exception (Execution exception in 0-10 speak) in two different ways (in most cases). 1. We throw a direct exception in the form of a JMS exception 2. We notify via the connection listener. I propose the following. 1. If we can throw a direct exception we will not notify via the Connection Listener. 2. If we cannot throw a direct exception (ex when using a message listener) we notify via the Connection Listener. Hope this clears up any confusion. As the next step, I will create a JIRA and post a patch for the above proposal. Regards, Rajith On Tue, May 24, 2011 at 4:17 PM, Rajith Attapattu <rajit...@gmail.com> wrote: > Folks, > > I am trying to tidy up the error handling code in the JMS client and > is soliciting ideas and feedback. > I also have rough proposal outlined below. > Please feel free to make suggestions/improvements for the following > solution or any alternative ideas that you might think maybe better. > > Currently if there is a session error we throw an exception on most > JMS methods in addition to notifying via the connection listener. > This is causing several issues with less than desirable results. > Besides I wonder if we need to notify the same exception in two > different ways. > > 1. There is a deadlock due to this. > 2. Even if the client is notified via a direct exception we still > throw a connection exception and close the connection (along with all > other sessions). > > I am wondering if the following is a good idea ? > > 1. If a direct exception can be thrown, then we don't notify via the > connection listener. > Ex. sending messages, creating a producer/consumer etc... > > 2. If a direct exception cannot be thrown (ex. Message Listener case) > then we notify via the connection listener. > In that case we don't care about the rest of the sessions being closed. > > 3. We mention in the documentation, that if a JMS exception is thrown, > they should recreate their session. > If a specific type of exception like > "MessageNotReadableException" is thrown, then they are advised to > treat it accordingly. > > Regards, > > Rajith > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:dev-subscr...@qpid.apache.org