Overview of the exit and schema
Syntax, and parameters used to establish a connection to a queue manager.
IBM WebSphere MQ Version 7.0.1, Fix Pack 4 defines the following syntax for an
entry point in an exit module.
void MQENTRY MQ_PRECONNECT_EXIT ( PMQNXP pExitParms
, PMQCHAR pQMgrName
, PPMQCNO ppConnectOpts
, PMQLONG pCompCode
, PMQLONG pReason)
During the MQCONN/X call execution, IBM MQ C Client
loads the exit module containing an implementation of the function syntax. It then invokes an exit
function to retrieve channel definitions. The retrieved channel definitions are then used to
establish connection to a queue manager.
Parameters
- pExitParms
- Type: PMQNXP input/output
- The PreConnection exit parameter structure. The structure is allocated and maintained by the
caller of the exit.
struct tagMQNXP
{
MQCHAR4 StrucId; /* Structure identifier */
MQLONG Version; /* Structure version number */
MQLONG ExitId; /* Type of exit */
MQLONG ExitReason; /* Reason for invoking exit */
MQLONG ExitResponse; /* Response from exit */
MQLONG ExitResponse2; /* Secondary response from exit */
MQLONG Feedback; /* Feedback code (reserved) */
MQLONG ExitDataLength; /* Exit data length */
PMQCHAR pExitDataPtr; /* Exit data */
MQPTR pExitUserAreaPtr; /* Exit user area */
PMQCD * ppMQCDArrayPtr; /* Array of pointers to MQCDs */
MQLONG MQCDArrayCount; /* Number of entries found */
MQLONG MaxMQCDVersion; /* Maximum MQCD version */
};
- pQMgrName
- Type: PMQCHAR input/output
- Name of the queue manager. On input, this parameter is the filter string supplied to the MQCONN
API call through the QMgrName parameter. This field might be blank, explicit,
or contain certain wildcard characters. The field is changed by the exit. The parameter is
NULL when the exit is called with MQXR_TERM.
- ppConnectOpts
- Type: ppConnectOpts input/output
- Options that control the action of MQCONNX. This is a pointer to an MQCNO connection options
structure that controls the action of the MQCONN API call. The parameter is NULL
when the exit is called with MQXR_TERM. The MQI client always provides an MQCNO structure to the
exit, even if it was not originally provided by the application. If an application provides an MQCNO
structure, the client makes a duplicate to pass it to the exit where it is modified. The client
retains the ownership of the MQCNO. An MQCD referenced through the MQCNO takes precedence over any
connection definition provided through the array. The client uses the MQCNO structure to connect to
the queue manager and the others are ignored.
- pCompCode
- Type: PMQLONG input/output
- Completion code. Pointer to an MQLONG that receives the exits completion code. It must be one of
the following values:
- MQCC_OK - Successful completion
- MQCC_WARNING - Warning (partial completion)
- MQCC_FAILED - Call failed
- pReason
- Type: PMQLONG input/output
- Reason qualifying pCompCode. Pointer to an MQLONG that receives the exit reason code. If the
completion code is MQCC_OK, the only valid value is: MQRC_NONE - (0, x'000') No
reason to report.
- If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code
field to any valid MQRC_* value.
Parent topic: Sample program for Connection Endpoint Lookup (CEPL)