|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Autoreconnect with JMS |
« View previous topic :: View next topic » |
Author |
Message
|
mrk.for.dev |
Posted: Tue Apr 27, 2021 7:38 am Post subject: Autoreconnect with JMS |
|
|
Novice
Joined: 11 Jan 2021 Posts: 23
|
A question that may seem easy to you but is not for me
What is the purpose of an autoreconnect?
Does it have to be configured on the QM only?
Or does the application code need to be updated as well?
MQ Version: 9.2.1
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 27, 2021 4:41 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It's a property of the connection factory, and you really want it if you are using a uniform cluster...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mrk.for.dev |
Posted: Tue Apr 27, 2021 11:06 pm Post subject: |
|
|
Novice
Joined: 11 Jan 2021 Posts: 23
|
If we use a RDQM cluster, and the application is connected to the Queue Manager using a floating IP address, we may need this autoreconnect? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 28, 2021 1:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mrk.for.dev wrote: |
If we use a RDQM cluster, and the application is connected to the Queue Manager using a floating IP address, we may need this autoreconnect? |
Yes you do. Every time the host changes in RDQM...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
hughson |
Posted: Wed Apr 28, 2021 3:35 am Post subject: Re: Autoreconnect with JMS |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
mrk.for.dev wrote: |
What is the purpose of an autoreconnect? |
Auto-reconnect remakes the connection to the queue manager when you lose it, say because of a network blip, or longer outage such as a failover of an HA or RDQM queue manager, or queue manager recycle.
If you don't use it, you can instead code your application to catch the error that it will be given when the connection is lost, and remake the connection explicitly in your code. Auto-reconnect just does it automatically to save you having to code for it explicitly.
You configure it at the application side not at the queue manager.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
mrk.for.dev |
Posted: Wed Apr 28, 2021 7:08 am Post subject: |
|
|
Novice
Joined: 11 Jan 2021 Posts: 23
|
Thank you very much for your help.
I created a JMS app to test the autoreconnect with
Code: |
cf.setIntProperty(WMQConstants.WMQ_CLIENT_RECONNECT_OPTIONS, WMQConstants.WMQ_CLIENT_RECONNECT); |
.
Test OK: when I restart the MQ instance after the application connects and before the
Test KO: when I restart the MQ instance, when the application is waiting on consumer.receive().
Is this normal to have an error : JMSCMQ0002: 'MQCMIT and ('MQCC_FAILED') ; reason '2003'?
If not, should an application that connects to MQ stay connected all the time until it reads a message? |
|
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
|
|
|
|