ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS setExceptionListener and STOP CONNECTION

Post new topic  Reply to topic
 JMS setExceptionListener and STOP CONNECTION « View previous topic :: View next topic » 
Author Message
tczielke
PostPosted: Thu Jul 07, 2016 10:02 am    Post subject: JMS setExceptionListener and STOP CONNECTION Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
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
View user's profile Send private message
fjb_saper
PostPosted: Thu Jul 07, 2016 10:14 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
tczielke
PostPosted: Thu Jul 07, 2016 10:43 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
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
View user's profile Send private message
tczielke
PostPosted: Tue Aug 02, 2016 7:36 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

It looks like issue #3 in this APAR probably corrects the issue I reported in this thread.

http://www-01.ibm.com/support/docview.wss?uid=swg1IT14820
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS setExceptionListener and STOP CONNECTION
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.