Connect to and disconnecting from a queue manager
To use IBM MQ programming services, a program must have a connection to a queue manager. Use this information to learn how to connect to and disconnect from a queue manager.
The way that this connection is made depends on the platform and the environment in which the program is operating:
- IBM MQ for Multiplatforms
- Programs that run in these environments can use the MQCONN MQI call to connect to, and the MQDISC call to disconnect from, a queue manager. Alternatively, programs can use the MQCONNX call.
- IBM MQ for z/OS batch
- Programs that run in this environment can use the MQCONN MQI call to connect to, and the MQDISC call to disconnect from, a queue manager. Alternatively, programs can use the MQCONNX call.
- IMS
- The IMS control region is connected to one or more queue managers when it starts. This connection is controlled by IMS commands. For information about how to control the IMS adapter on z/OS, see Administer IBM MQ for z/OS. However, writers of message queuing IMS programs must use the MQCONN MQI call to specify the queue manager to which they want to connect. They can use the MQDISC call to disconnect from that queue manager.
- CICS Transaction Server for z/OS
- CICS programs do not need to do any work to connect to a queue manager because the CICS system itself is connected. This connection is typically made automatically at initialization, but we can also use the CKQC transaction that is supplied with IBM MQ for z/OS. For more information about CKQC, see Administer IBM MQ for z/OS.
- TXSeries for Windows and Open Systems
- These programs do not need to do any work to connect to a queue manager because the CICS system itself is connected. Therefore, only one connection at a time is supported. CICS applications must issue an MQCONN call to obtain a connection handle, and an MQDISC call before they exit.
Use the following links to find out more about connecting and disconnecting from a queue manager:
- Connect to a queue manager using the MQCONN call
- Connect to a queue manager using the MQCONNX call
- Disconnect programs from a queue manager using MQDISC
- Connect to a queue manager using the MQCONN call
Use this information to learn how to connect to a queue manager using the MQCONN call. - Connect to a queue manager using the MQCONNX call
The MQCONNX call is similar to the MQCONN call, but includes options to control the way that the call works. - Disconnect programs from a queue manager using MQDISC
Use this information to learn about disconnecting programs from a queue manager using MQDISC.
Parent topic: Writing a procedural application for queuing
Related concepts
- The Message Queue Interface overview
- Opening and closing objects
- Put messages on a queue
- Getting messages from a queue
- Inquiring about and setting object attributes
- Committing and backing out units of work
- Starting IBM MQ applications using triggers
- Work with the MQI and clusters
- Use and writing applications on IBM MQ for z/OS
- IMS and IMS bridge applications on IBM MQ for z/OS