Author |
Message
|
gfrench |
Posted: Mon Mar 02, 2015 3:33 am Post subject: MQ Client Auto-Reconncect |
|
|
 Acolyte
Joined: 10 Feb 2002 Posts: 71
|
I'm playing with Version 7.5.0.3 server and client on same windows machine.
I can run the samples amqsphac and amqsghac to put and get messages from a queue. I can see they are using my mqclient.ini and when I take the queue manager down with an endmqm -r GJF I can see it tried reconnecting around every 8 seconds
Quote: |
CHANNELS:
DefRecon=QMGR ; Auto reconnect but only to same QMGR
ReconDelay=(8000,1000) ; 8 seconds delay before reconnect attempt
MQReconnectTimeout=1800 ; Time limit in secs (half hour) before giving up
ServerConnectionParms=TO.GJF/TCP/localhost(1414)
|
My understanding, based on the manuals, is that without modification of code, I can make an existing MQCONN program autoreconnect using the mqclient.ini. However no matter how I try, using the same process as I do with amqsphac, with amqsputc I always get 2009, broken connection.
I've possibly answered my own question here, but can someone confirm its the way amqsputc has been compiled meaning it doesn't meet the
requirement? |
|
Back to top |
|
 |
PaulClarke |
Posted: Mon Mar 02, 2015 3:59 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Well, certainly you need to have a thread enabled program for reconnect to happen. However, if I had to guess I'd suspect it is the way the two are connecting that accounts for the change. AMQSPHAC uses MQCNO_RECONNECT whereas AMQPUTC does, by default. Which means that AMQSPUTC will be using MQCNO_RECONNECT_AS_DEF which in turns means that it will take whether reconnect is active from the client channel definition. What is the DEFRECON setting of your CLNTCONN?
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
gfrench |
Posted: Mon Mar 02, 2015 5:06 am Post subject: |
|
|
 Acolyte
Joined: 10 Feb 2002 Posts: 71
|
You are correct with AMQSPHAC doing MQCONNX with cno.Options = MQCNO_RECONNECT
AMQSPUT does the old MQCONN so no options on it. However I specified DEFRECON(QMGR) on the CLNTCONN chl. |
|
Back to top |
|
 |
PaulClarke |
Posted: Mon Mar 02, 2015 6:09 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Ah Ok. I saw where you said you had put DEFRECONN in the INI file but I saw no mention of the channel definition.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Mar 02, 2015 7:11 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
gfrench,
This is a good write up on the topic of reconnectable clients and where it does and does not work.
Webcast replay: Exploiting the Automatic Client Reconnect feature in WebSphere MQ 7
http://www-304.ibm.com/support/docview.wss?uid=swg27038186 _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
gfrench |
Posted: Mon Mar 02, 2015 8:26 am Post subject: |
|
|
 Acolyte
Joined: 10 Feb 2002 Posts: 71
|
Thanks. That link spells it out quite clearly
Quote: |
The MQ client application (sample amqsputc) was not developed to take advantage of the automatic client reconnection |
However, the manuals are a bit sketchy with comments like:-
Quote: |
You can make your client applications reconnect automatically, without writing any additional code, by configuring a number of components |
Quote: |
Many applications are written in such a way that they are able to take advantage of auto-reconnection with no additional coding. |
We also fulfill all the requirements in the "Table 2. Automatic reconnection configuration requirements" (excepting I'm not sure if the compiled amqsputc is threaded).
So is this a documentation bug? Does the table needs to state, the code needs to use MQCONNX and not MQCONN to allow auto reconnection? If its not this can someone explain why amqsput was not written for reconnection?
Appreciate any help. Thanks |
|
Back to top |
|
 |
zpat |
Posted: Mon Mar 02, 2015 8:34 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
The point of all this debate - is that we would like to leverage the auto-reconnect feature without modifying existing applications (in some cases we don't own them).
Seems this is really a pipe-dream. _________________ 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 |
|
 |
PaulClarke |
Posted: Mon Mar 02, 2015 10:10 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Well, I'm pretty certain this used to work. That is, after all, the whole point of the DEFRECONN attribute. However, I have just tried it myself and I can't get AMQSPUTC to reconnect either. Now, it may well be something silly I'm missing but I can't think what it is. I took a trace and the key line is rcnCheckReconnectable. That function prints out "Session not reconnectable". Now, if memory serves that function should take note of the default reconnect setting from the channel definition.
Clearly something is amiss however since I can't step through the code any more I can't see just what it is.
If I were you I think I'd be raising a PMR and seeing what MQ Development say about it.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
|