|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Reconnect logic for java classes |
« View previous topic :: View next topic » |
Author |
Message
|
kalam475 |
Posted: Tue Mar 14, 2017 11:35 pm Post subject: Reconnect logic for java classes |
|
|
Acolyte
Joined: 16 Jan 2015 Posts: 63
|
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 |
|
 |
mqjeff |
Posted: Wed Mar 15, 2017 4:47 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There's nothing different about reconnecting to MQ from reconnecting to a database or a website or a network enabled dishwasher. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
zpat |
Posted: Wed Mar 15, 2017 6:05 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 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 |
|
 |
gbaddeley |
Posted: Wed Mar 15, 2017 3:14 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 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 |
|
 |
|
|
 |
|
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
|
|
|
|