MQRC 2009: Connection broken
MQRC 2009 (MQRC_
Other names for this code
Also written as RC2009, reason code 2009, MQ 2009, MQ error 2009, MQRC_CONNECTION_BROKEN, 07D9, 0x07D9, connection broken, MQJE001 Reason 2009, JMSCMQ0001 2009.
What it means
The queue manager, or the network path to it, went away while the application was connected. The call that noticed it fails with MQCC_
For a local (bindings) application, 2009 usually means the queue manager ended or failed. For a client application it more often means the TCP connection broke. A firewall dropped an idle session, the server-connection channel was stopped, or a network error closed the socket. IBM warns that on a client, a call that returns 2009 may in fact have completed on the queue manager. Treat the outcome of that one call as unknown.
Uncommitted work in the unit of work is backed out when the queue manager coordinates it. The program must reconnect, reopen its queues, and redo the work.
Common causes
- The queue manager was stopped, failed or switched over, for example during maintenance or a multi-instance or HA failover.
- A firewall or load balancer dropped a TCP session it thought was idle. Long MQGET waits on client connections are a common victim.
- An administrator stopped the server-connection channel instance or ended the connection, for example with
STOP CHANNELorSTOP CONNon distributed MQ. - A network error such as a reset socket, a cable or VPN drop, or a client host that was suspended.
- A client channel hit a channel limit (MAXINSTC or MAXINST on the channel, or the queue manager's overall limit, MaxChannels in qm.ini or MAXCHL on z/OS) and was ended. A new connection refused for this reason normally gets 2537 instead.
- On z/OS IMS, the IMS adapter connection to the MQ subsystem isn't active.
How to find the problem
- Check whether the queue manager is running. Use
dspmqon distributed MQ. On z/OS, check the MSTR address space and the CSQ messages in SYSLOG. - For client applications, read the queue manager error log (AMQERR01.LOG) and the client's own error log at the time of the failure. Look for messages about a receive error or a channel ending, which show which side closed the socket.
- Use
DISPLAY CHSTATUS(APP.to see current instances, and compare HBINT and KAINT with the timeouts on firewalls in the path.SVRCONN) ALL - Check the time pattern. Failures after a fixed idle time, such as exactly 30 or 60 minutes, point to a firewall or load balancer timeout.
- On z/OS IMS, issue
/DIS SUBSYSto see whether the MQ subsystem connection is active.
How to fix it
- Make the application reconnect. Catch 2009, back out if needed, connect again with MQCONN or MQCONNX, reopen its queues and retry, with a pause between attempts.
- For clients, consider automatic client reconnect (MQCNO_
RECONNECT, or the reconnect options on a JMS connection factory) so short outages are handled for you. - Lower the channel heartbeat interval (HBINT) below the firewall idle timeout so the session never looks idle. Ask the network team for the timeout value.
- On z/OS IMS, start the subsystem connection with
/STA SUBSYS. CICS applications don't call MQCONN, because the CICS adapter connects for them. - Make the program safe to retry, because the last call before 2009 may have worked on a client.
What it looks like
JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').IBM documentation
IBM documentation: MQRC 2009. Use the documentation for your installed release.
Related codes
Questions
Is MQRC 2009 a network problem or a queue manager problem?
It can be either. For bindings applications it usually means the queue manager ended. For clients it is more often the network, especially firewalls that drop idle sessions.
Was my message sent if I got 2009 on MQPUT?
Not certainly. On a client connection the put may have reached the queue manager before the connection broke. If the put was under syncpoint and not committed, it was backed out.
What is the difference between 2009 and 2059?
2059 means the connect attempt itself failed because the queue manager isn't available. 2009 means a connection that already worked was lost later.