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 IndexIBM MQ Installation/Configuration SupportReconnect logic for java classes

Post new topicReply to topic
Reconnect logic for java classes View previous topic :: View next topic
Author Message
kalam475
PostPosted: Tue Mar 14, 2017 11:35 pm Post subject: Reconnect logic for java classes Reply with quote

Acolyte

Joined: 16 Jan 2015
Posts: 56

I want to handle MQRC 2009 CONNECTION_BROKEN in my java code which does not support automatic client reconnect. so we have to write our own reconnection logic if I am not wrong.

Is there any example to guide me to write the reconnection logic any simple example would be of great help.Thanks

Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Mar 15, 2017 4:47 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17257

There's nothing different about reconnecting to MQ from reconnecting to a database or a website or a network enabled dishwasher.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Mar 15, 2017 6:05 am Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5437
Location: UK

If you lose your connection handle (e.g. MQRC 2009), you can just connect again - however it's best to sleep for at least 15 seconds between attempts to connect. Otherwise your app can flood the network with attempts.

Each time it fails - log the error so you can see the reason code (or linked exception), some reason codes may not be worth retrying for as they will require manual intervention such as MQRC 2035.

Keep retrying for however long you want, just remember to sleep between attempts. Consider how an alert might be raised for a repeated failure.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Wed Mar 15, 2017 3:14 pm Post subject: Reply with quote

Padawan

Joined: 25 Mar 2003
Posts: 1657
Location: Melbourne, Australia

Depending on where the 2009 occurs, you may need to take action on the app transaction that was in progress, such as back it out, retry / reprocess &/or log an error for investigation.
_________________
Glenn
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Installation/Configuration SupportReconnect logic for java classes
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.