Connecting to a queue manager using the MQCONN call

 

In general, we can connect either to a specific queue manager, or to the default queue manager:

Alternatively, in the z/OS™ MVS batch, TSO, and RRS environments you can connect to any one queue manager within a queue-sharing group. The MQCONN or MQCONNX request selects any one of the active members of the group.

The queue manager that you connect to must be local to the task. This means that it must belong to the same system as the WebSphere MQ application.

In the IMS™ environment, the queue manager must be connected to the IMS control region and to the dependent region that the program uses. The default queue manager is specified in the CSQQDEFV module when WebSphere MQ for z/OS is installed.

With the TXSeries CICS environment, and TXSeries for Windows and AIX, the queue manager must be defined as an XA resource to CICS.

To connect to the default queue manager, call MQCONN, specifying a name consisting entirely of blanks or starting with a null (X'00') character.

Within WebSphere MQ on UNIX systems, an application must be authorized for it to successfully connect to a queue manager. For more information, see the the WebSphere MQ System Administration Guide.

The output from MQCONN is:

Use the connection handle on subsequent MQI calls.

If the reason code indicates that the application is already connected to that queue manager, the connection handle that is returned is the same as the one that was returned when the application first connected. The application should not issue the MQDISC call in this situation because the calling application will expect to remain connected.

The scope of the connection handle is the same as that of the object handle (see Opening objects using the MQOPEN call).

Descriptions of the parameters are given in the description of the MQCONN call in the Application Programming Reference.

The MQCONN call fails if the queue manager is in a quiescing state when you issue the call, or if the queue manager is shutting down.

 

Parent topic:

Connecting to and disconnecting from a queue manager


fg12030_