ConnectionId (MQBYTE24)
ConnectionId is a unique 24-byte identifier that allows IBM MQ to reliably identify an application. An application can use this identifier for correlation in PUT and GET calls. This output parameter has an initial value of 24 null bytes in all programming languages.
The queue manager assigns a unique ID to all connections, however they are established. If an MQCONNX establishes the connection with a version 5 MQCNO, the application can determine the ConnectionId from the returned MQCNO. The assigned identifier is guaranteed to be unique among all other identifiers that IBM MQ generates, such as CorrelId, MsgID, and GroupId.
Use the ConnectionId to identify long running units of work using the PCF command Inquire Connection or the MQSC command DISPLAY CONN. The ConnectionId used by MQSC commands (CONN) is derived from the ConnectionId returned here. The PCF Inquire and Stop Connection commands can use the ConnectionId returned here without modification.
We can use the ConnectionId to force the end of a long running unit of work, by specifying the ConnectionId using the PCF command Stop Connection or the MQSC command STOP CONN. See Stop Connection and STOP CONN for more information about using these commands.
This field is not returned if Version is less than MQCNO_VERSION_5.
The length of this field is given by MQ_CONNECTION_ID_LENGTH.