This is one topic in a series of blog posts.
- The ups and downs of MQ Reconnect – the basics
- The ups and downs of MQ Reconnect – what do I need to do to get it to work?
- The ups and downs of MQ Reconnect – the classic MQ scenarios
- The ups and downs of MQ Reconnect – how can I tell if automatic reconnect has happened?
- The ups and downs of MQ Reconnect – little problems
- The ups and downs of MQ Reconnect – frustrating problems.
If there are problems during MQ reconnection, the queue manager may not report them.
I had a SERVER queue defined on QMA and QMC, then the reconnection worked OK.
If I deleted the queue from QMC.
I got ( using the MQCB exit to print the status)
18:05:37 : EVENT : Connection Reconnecting (Delay: 1135ms) 18:05:38 : EVENT : Reconnection failed 18:05:38 : EVENT : Connection Broken MQGET get cc 2 rc 2548 MQRC_RECONNECT_FAILED
26/03/19 18:05:17 - Process(1617.4) User(colinpaice) Program(amqrmp) Host(colinpaice) Installation(Installation1) VRMF(220.127.116.11) QMgr(QMC) Time(2019-03-26T18:05:17.489Z) RemoteHost(127.0.0.1) CommentInsert1(localhost (127.0.0.1)) CommentInsert2(TCP/IP) CommentInsert3(COLIN) AMQ9209E: Connection to host 'localhost (127.0.0.1)' for channel 'COLIN' closed.
AMQ9999E: Channel 'COLIN' to host '127.0.0.1' ended abnormally.
Not much use to tell me where the problem was, and there was nothing else to help me find out what the problem was
I took an internal trace, formatted it, and looked for a likely problem. I could use the time stamp to narrow down the range of records.
The trace had MQI:MQOPEN HConn=0140000F HObj=00000000 rc=00000825 ObjType=00000001 ObjName=SERVER
0825 is MQRC_UNKNOWN_OBJECT_NAME
I found it helpful for the application to explicitly connect to the queue manager. In this case, I got
MQ connx to QMC cc 0 rc 0 MQRC_NONE QMNAME is QMC Return code from MQOPEN to SERVER is cc 2 rc 2085,MQRC_UNKNOWN_OBJECT_NAME
From this I could see what the problem was.
If you are going to use MQ reconnection you need to review your application.
- Print out the queue manager name at start up.
- Use MQCB to provide a routine which prints out when reconnection occurs, and which queue manager is currently being used.
- You should now have an trail of which queue manager was being used at which time, and can see.
- Try connecting the application to every queue manager, and make sure it works successfully. If you do not do this it will be hard to tell why a connection failed.