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 » Automate recovery for client on 2009 error

Post new topic  Reply to topic
 Automate recovery for client on 2009 error « View previous topic :: View next topic » 
Author Message
WBI_user
PostPosted: Thu Oct 12, 2006 12:10 pm    Post subject: Automate recovery for client on 2009 error Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

We have JMS clients doing synchronous wait for messages on the server. If there is any network problem, it will get JMSException with embedded MQRC of 2009.
"com.ibm.mq.MQException: MQJE001: Completion Code 2 Reason 2009"
We want to provide some automatic retry for this error. For example, close the connection and reconnect.
Is there any concern about this kind of retry ? We will limit the retry to 2 or 3 times to prevent it from retrying forever.
I am not a JMS programmer. Is there a method already exist to extract just the reason code from the JMSException so that we can check and do conditional branch to retry?
or I can simply extract the field after reason in the exception message. This will rely on IBM not chnaging the format of the exception message.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Oct 12, 2006 12:18 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The JMS exception will have a Linked Exception, which will be an MQException, which should have a getReasonCode() or some such.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
WBI_user
PostPosted: Thu Oct 12, 2006 1:06 pm    Post subject: Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

The code to trap the exception is the same as in the manual
:
} catch (JMSException je) {
System.out.println("caught "+je);
Exception e = je.getLinkedException();
if (e != null) {
System.out.println("linked exception: "+e);
}

I then tried
int reacode = e.getReasonCode()
System.out.println("Reason code is "+ reacode);

But get error
cannot resolve symbol
symbol : method getReasonCode()
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Oct 12, 2006 1:10 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You won't get it from a plain Exception.

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/csqzaw1462.htm
_________________
I am *not* the model of the modern major general.
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 » Automate recovery for client on 2009 error
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.