|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JMS setExceptionListener and STOP CONNECTION |
« View previous topic :: View next topic » |
Author |
Message
|
tczielke |
Posted: Thu Jul 07, 2016 10:02 am Post subject: JMS setExceptionListener and STOP CONNECTION |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
I may open a PMR about this, but was wondering if anyone had any experience or insight in what I am seeing with JMS.
I have a simple JMSReceiver program where I am setting up an ExceptionListener on the connection. The code looks like this:
Code: |
Context ctx = new InitialContext();
QueueConnectionFactory factory = (QueueConnectionFactory)
ctx.lookup("myQCFClient");
QueueConnection connection = factory.createQueueConnection();
connection.setExceptionListener(this);
|
There is also an onException method to get invoked when an exception is detected on the connection. This onException method will then redrive a reconnection to the queue manager. The code also sets up an asynchronous MessageListener to listen for messages on a queue.
This code all works great when I shut down the queue manager. The onException method gets invoked and a reconnection is redriven and is successful when the queue manager is back up. However, if I do just a STOP CONNECTION on the JMSReceiver connections, the onException method is not called. I can see in the queue manager the connections are gone. Of course, if I then try to put messages to the queue that the JMSReceiver is listening on, the onMessage is not invoked (since the connections have been broken to the queue manager).
Is this a bug that a STOP CONNECTION does not invoke my onException method for my ExceptionListener for this JMSReceiver program?
I do have ASYNCEXCEPTION(ALL) for my myQCFClient queue connection factory. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 07, 2016 10:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Don't know what is happening behind the scenes, but a stopped connection is not the same thing as an interrupted one...
It may only be semantics, but I would suspect that internally the queue manager does not think anything bad happened...
Like say one thread closing a connection before the other thread is done with it...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
tczielke |
Posted: Thu Jul 07, 2016 10:43 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
If the JMSReceiver program is changed to do a synchronous GET instead of an asynchronous GET and you do a STOP CONNECTION on the JMSReceiver connections, the JMSReceiver does give you an error of a 2009 (broken connection) on the synchronous GET call. To me, it would follow then that an asynchronous GET that has a registered ExceptionListener should have an exception raised if a STOP CONNECTION is done on the JMS program's connections. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
tczielke |
Posted: Tue Aug 02, 2016 7:36 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|