This section tells you how to invoke the exit functions available. The descriptions of the individual functions start at The API exit functions. This section begins with some general information to help you when using these function calls.
The following general rules apply when invoking API exit routines:
In general, all errors from exit functions are communicated back to the exit handler using the ExitResponse and ExitResponse2 fields in MQAXP. These errors in turn are converted into MQCC_* and MQRC_* values and communicated back to the application in the CompCode and Reason fields. However, any errors encountered in the exit handler logic are communicated back to the application as MQCC_* and MQRC_* values in the CompCode and Reason fields.
If an MQ_TERM_EXIT function returns an error:
In other words, the exit cannot be unloaded as it might still be in use. Also, other registered exits further down in the exit chain for which the before exit was successful, will be driven in the reverse order.
While processing an explicit MQCONN or MQCONNX call, exit handling logic sets up the exit execution environment before invoking the exit initialization function (MQ_INIT_EXIT). Exit execution environment setup involves loading the exit, acquiring storage for, and initializing exit parameter structures. The exit configuration handle is also allocated at this point.
If errors occur during this phase, the MQCONN or MQCONNX call fails with CompCode MQCC_FAILED and one of the following reason codes:
While processing an explicit MQDISC call, or an implicit disconnect request as a result of an application ending, exit handling logic might need to clean up the exit execution environment after invoking the exit termination function (MQ_TERM_EXIT), if registered. Cleaning up the exit execution environment involves releasing storage for exit parameter structures, possibly deleting any modules previously loaded into memory.
If errors occur during this phase, an explicit MQDISC call fails with CompCode MQCC_FAILED and the following reason code (errors are not highlighted on implicit disconnect requests):
This section describes each of the exit functions and its parameters, as follows:
MQ_BACK_EXIT provides a backout exit function to perform before and after backout processing. Use function identifier MQXF_BACK with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after backout call exit functions.
The interface to this functions:
MQ_BACK_EXIT (&ExitParms, &ExitContext, &Hconn, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code qualifying completion code */
The queue manager then logically calls the exit as follows:
MQ_BACK_EXIT (&ExitParms, &ExitContext, &Hconn, &CompCode, &Reason);
Your exit must match the following C function prototype:
void MQENTRY MQ_BACK_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_BEGIN_EXIT provides a begin exit function to perform before and after MQBEGIN call processing. Use function identifier MQXF_BEGIN with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQBEGIN call exit functions.
The interface to this function is:
MQ_BEGIN_EXIT (&ExitParms, &ExitContext, &Hconn, &pBeginOptions, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ PMQBO pBeginOptions; /* Ptr to begin options */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code qualifying completion code */
The queue manager then logically calls the exit as follows:
MQ_BEGIN_EXIT (&ExitParms, &ExitContext, &Hconn, &pBeginOptions, &CompCode, &Reason);
Your exit must match the following C function prototype:
void MQENTRY MQ_BEGIN_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PPMQBO ppBeginOptions, /* Address of ptr to begin options */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_CLOSE_EXIT provides a close exit function to perform before and after MQCLOSE call processing. Use function identifier MQXF_CLOSE with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQCLOSE call exit functions.
The interface to this function is:
MQ_CLOSE_EXIT (&ExitParms, &ExitContext, &Hconn, &pHobj, &Options, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ PMQHOBJ pHobj; /* Ptr to object handle */ MQLONG Options; /* Close options */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_CLOSE_EXIT (&ExitParms, &ExitContext,&Hconn, &pHobj, &Options, &CompCode, &Reason);
Your exit must match the following C function prototype:
void MQENTRY MQ_CLOSE_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PPMQHOBJ ppHobj, /* Address of ptr to object handle */ PMQLONG pOptions, /* Address of close options */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_CMIT_EXIT provides a commit exit function to perform before and after commit processing. Use function identifier MQXF_CMIT with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after commit call exit functions.
If a commit operation fails, and the transaction is backed out, the MQCMIT call fails with MQCC_WARNING and MQRC_BACKED_OUT. These return and reason codes are passed into any after MQCMIT exit functions to give the exit functions an indication that the unit of work has been backed out.
The interface to this function is:
MQ_CMIT_EXIT (&ExitParms, &ExitContext, &Hconn, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code qualifying completion code */
The queue manager then logically calls the exit as follows:
MQ_CMIT_EXIT (&ExitParms, &ExitContext,&Hconn, &CompCode, &Reason);
Your exit must match the following C function prototype:
void MQENTRY MQ_CMIT_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_CONNX_EXIT provides:
The same interface, as described below, is invoked for both MQCONN and MQCONNX call exit functions.
When the message channel agent (MCA) responds to an inbound client connection, the MCA can connect and make a number of WebSphere MQ API calls before the client state is fully known. These API calls call the API exit functions with the MQAXC based on the MCA program itself (for example in the UserId and ConnectionName fields of the MQAXC).
When the MCA responds to subsequent inbound client API calls, the MQAXC structure is based on the inbound client, setting the UserId and ConnectionName fields appropriately.
The queue manager name set by the application on an MQCONN or MQCONNX call is passed to the underlying connect call. Any attempt by a before MQ_CONNX_EXIT to change the name of the queue manager has no effect.
Use function identifiers MQXF_CONN and MQXF_CONNX with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQCONN and MQCONNX call exit functions.
An MQ_CONNX_EXIT exit called for reason MQXR_BEFORE must not issue any WebSphere MQ API calls, as the correct environment has not been set up at this time.
The interface to MQCONN and MQCONNX is identical:
MQ_CONNX_EXIT (&ExitParms, &ExitContext, &pQMgrName, &pConnectOpts, &pHconn, &CompCode, &Reason);
where the parameters are:
See "MQCNO - Connect options" in the WebSphere MQ Application Programming Reference for details.
For exit function MQXF_CONN, pConnectOpts points to the default connect options structure (MQCNO_DEFAULT).
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ PMQCHAR pQMgrName; /* Ptr to Queue manager name */ PMQCNO pConnectOpts; /* Ptr to Connection options */ PMQHCONN pHconn; /* Ptr to Connection handle */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_CONNX_EXIT (&ExitParms, &ExitContext, &pQMgrName, &pConnectOps, &pHconn, &CompCode, &Reason);
Your exit must match the following C function prototype:
void MQENTRY MQ_CONNX_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PPMQCHAR ppQMgrName, /* Address of ptr to queue manager name */ PPMQCNO ppConnectOpts, /* Address of ptr to connection options */ PPMQHCONN ppHconn, /* Address of ptr to connection handle */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_DISC_EXIT provides a disconnect exit function to perform before and after MQDISC exit processing. Use function identifier MQXF_DISC with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQDISC call exit functions.
The interface to this function is
MQ_DISC_EXIT (&ExitParms, &ExitContext, &pHconn, &CompCode, &Reason);
where the parameters are:
For the before MQDISC call, the value of this field is one of:
For the after MQDISC call, the value of this field is zero or a value set by a previous exit function invocation.
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ PMQHCONN pHconn; /* Ptr to Connection handle */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_DISC_EXIT (&ExitParms, &ExitContext, &pHconn, &CompCode, &Reason);
Your exit must match the following C function prototype:
void MQENTRY MQ_DISC_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PPMQHCONN ppHconn, /* Address of ptr to connection handle */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_GET_EXIT provides a get exit function to perform before and after MQGET call processing. There are two function identifiers:
The interface to this function is:
MQ_GET_EXIT (&ExitParms, &ExitContext, &Hconn, &Hobj, &pMsgDesc, &pGetMsgOpts, &BufferLength, &pBuffer, &pDataLength, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ MQHOBJ Hobj; /* Object handle */ PMQMD pMsgDesc; /* Ptr to message descriptor */ PMQPMO pGetMsgOpts; /* Ptr to get message options */ MQLONG BufferLength; /* Message buffer length */ PMQBYTE pBuffer; /* Ptr to message buffer */ PMQLONG pDataLength; /* Ptr to data length field */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_GET_EXIT (&ExitParms, &ExitContext, &Hconn, &Hobj, &pMsgDesc, &pGetMsgOpts, &BufferLength, &pBuffer, &pDataLength, &CompCode, &Reason)
Your exit must match the following C function prototype:
void MQENTRY MQ_GET_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PMQHOBJ pHobj, /* Address of object handle */ PPMQMD ppMsgDesc, /* Address of ptr to message descriptor */ PPMQGMO ppGetMsgOpts, /* Address of ptr to get message options */ PMQLONG pBufferLength, /* Address of message buffer length */ PPMQBYTE ppBuffer, /* Address of ptr to message buffer */ PPMQLONG ppDataLength, /* Address of ptr to data length field */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_INIT_EXIT provides connection level initialization, indicated by setting ExitReason in MQAXP to MQXR_CONNECTION. During the initialization, note the following:
The interface to MQ_INIT_EXIT is:
MQ_INIT_EXIT (&ExitParms, &ExitContext, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The CompCode and Reason returned to the application depend on the value of the ExitResponse field in MQAXP.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_INIT_EXIT (&ExitParms, &ExitContext, &CompCode, &Reason)
Your exit must match the following C function prototype:
void MQENTRY MQ_INIT_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_INQ_EXIT provides an inquire exit function to perform before and after MQINQ call processing. Use function identifier MQXF_INQ with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQINQ call exit functions.
The interface to this function is:
MQ_INQ_EXIT (&ExitParms, &ExitContext, &Hconn, &Hobj, &SelectorCount, &pSelectors, &IntAttrCount, &pIntAttrs, &CharAttrLength, &pCharAttrs, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ MQHOBJ Hobj; /* Object handle */ MQLONG SelectorCount; /* Count of selectors */ PMQLONG pSelectors; /* Ptr to array of attribute selectors */ MQLONG IntAttrCount; /* Count of integer attributes */ PMQLONG pIntAttrs; /* Ptr to array of integer attributes */ MQLONG CharAttrLength; /* Length of char attributes array */ PMQCHAR pCharAttrs; /* Ptr to character attributes */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code qualifying completion code */
The queue manager then logically calls the exit as follows:
MQ_INQ_EXIT (&ExitParms, &ExitContext, &Hconn, &Hobj, &SelectorCount, &pSelectors, &IntAttrCount, &pIntAttrs, &CharAttrLength, &pCharAttrs, &CompCode, &Reason)
Your exit must match the following C function prototype:
void MQENTRY MQ_INQ_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PMQHOBJ pHobj, /* Address of object handle */ PMQLONG pSelectorCount, /* Address of selector count */ PPMQLONG ppSelectors, /* Address of ptr to array of selectors */ PMQLONG pIntAttrCount; /* Address of count of integer attributes */ PPMQLONG ppIntAttrs, /* Address of ptr to array of integer attributes */ PMQLONG pCharAttrLength, /* Address of character attribute length */ PPMQCHAR ppCharAttrs, /* Address of ptr to character attributes array */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_OPEN_EXIT provides an open exit function to perform before and after MQOPEN call processing. Use function identifier MQXF_OPEN with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQOPEN call exit functions.
The interface to this function is
MQ_OPEN_EXIT (&ExitParms, &ExitContext, &Hconn, &pObjDesc, &Options, &pHobj, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ PMQOD pObjDesc; /* Ptr to object descriptor */ MQLONG Options; /* Open options */ PMQHOBJ pHobj; /* Ptr to object handle */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_OPEN_EXIT (&ExitParms, &ExitContext, &Hconn, &pObjDesc, &Options, &pHobj, &CompCode, &Reason);
Your exit must match the following C function prototype:
void MQENTRY MQ_OPEN_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PPMQOD ppObjDesc, /* Address of ptr to object descriptor */ PMQLONG pOptions, /* Address of open options */ PPMQHOBJ ppHobj, /* Address of ptr to object handle */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_PUT_EXIT provides a put exit function to perform before and after MQPUT call processing. Use function identifier MQXF_PUT with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQPUT call exit functions.
The interface to this function is:
MQ_PUT_EXIT (&ExitParms, &ExitContext, &Hconn, &Hobj, &pMsgDesc, &pPutMsgOpts, &BufferLength, &pBuffer, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ MQHOBJ Hobj; /* Object handle */ PMQMD pMsgDesc; /* Ptr to message descriptor */ PMQPMO pPutMsgOpts; /* Ptr to put message options */ MQLONG BufferLength; /* Message buffer length */ PMQBYTE pBuffer; /* Ptr to message data */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_PUT_EXIT (&ExitParms, &ExitContext, &Hconn, &Hobj, &pMsgDesc, &pPutMsgOpts, &BufferLength, &pBuffer, &CompCode, &Reason)
Your exit must match the following C function prototype:
void MQENTRY MQ_PUT_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PMQHOBJ pHobj, /* Address of object handle */ PPMQMD ppMsgDesc, /* Address of ptr to message descriptor */ PPMQPMO ppPutMsgOpts, /* Address of ptr to put message options */ PMQLONG pBufferLength, /* Address of message buffer length */ PPMQBYTE ppBuffer, /* Address of ptr to message buffer */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_PUT1_EXIT provides a put one message only exit function to perform before and after MQPUT1 call processing. Use function identifier MQXF_PUT1 with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQPUT1 call exit functions.
The interface to this function is:
MQ_PUT1_EXIT (&ExitParms, &ExitContext, &Hconn, &pObjDesc, &pMsgDesc, &pPutMsgOpts, &BufferLength, &pBuffer, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ PMQOD pObjDesc; /* Ptr to object descriptor */ PMQMD pMsgDesc; /* Ptr to message descriptor */ PMQPMO pPutMsgOpts; /* Ptr to put message options */ MQLONG BufferLength; /* Message buffer length */ PMQBYTE pBuffer; /* Ptr to message data */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_PUT1_EXIT (&ExitParms, &ExitContext, &Hconn, &pObjDesc, &pMsgDesc, &pPutMsgOpts, &BufferLength, &pBuffer, &CompCode, &Reason)
Your exit must match the following C function prototype:
void MQENTRY MQ_PUT1_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PPMQOD ppObjDesc, /* Address of ptr to object descriptor */ PPMQMD ppMsgDesc, /* Address of ptr to message descriptor */ PPMQPMO ppPutMsgOpts, /* Address of ptr to put message options */ PMQLONG pBufferLength, /* Address of message buffer length */ PPMQBYTE ppBuffer, /* Address of ptr to message buffer */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_SET_EXIT provides an inquire exit function to perform before and after MQSET call processing. Use function identifier MQXF_SET with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQSET call exit functions.
The interface to this function is:
MQ_SET_EXIT (&ExitParms, &ExitContext, &Hconn, &Hobj, &SelectorCount, &pSelectors, &IntAttrCount, &pIntAttrs, &CharAttrLength, &pCharAttr, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQHCONN Hconn; /* Connection handle */ MQHOBJ Hobj; /* Object handle */ MQLONG SelectorCount; /* Count of selectors */ PMQLONG pSelectors; /* Ptr to array of attribute selectors */ MQLONG IntAttrCount; /* Count of integer attributes */ PMQLONG pIntAttrs; /* Ptr to array of integer attributes */ MQLONG CharAttrLength; /* Length of char attributes array */ PMQCHAR pCharAttrs; /* Ptr to character attributes */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code qualifying completion code */
The queue manager then logically calls the exit as follows:
MQ_SET_EXIT (&ExitParms, &ExitContext, &Hconn, &Hobj, &SelectorCount, &pSelectors, &IntAttrCount, &pIntAttrs, &CharAttrLength, &pCharAttrs, &CompCode, &Reason)
Your exit must match the following C function prototype:
void MQENTRY MQ_SET_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQHCONN pHconn, /* Address of connection handle */ PMQHOBJ pHobj, /* Address of object handle */ PMQLONG pSelectorCount, /* Address of selector count */ PPMQLONG ppSelectors, /* Address of ptr to array of selectors */ PMQLONG pIntAttrCount; /* Address of count of integer attributes */ PPMQLONG ppIntAttrs, /* Address of ptr to array of integer attributes */ PMQLONG pCharAttrLength, /* Address of character attribute length */ PPMQCHAR ppCharAttrs, /* Address of ptr to character attributes array */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
MQ_TERM_EXIT provides connection level termination, registered with a function identifier of MQXF_TERM and ExitReason MQXR_CONNECTION. If registered, MQ_TERM_EXIT is called once for every disconnect request.
As part of the termination, storage no longer required by the exit can be released, and any clean up required can be performed.
If an MQ_TERM_EXIT fails with MQXCC_FAILED, the queue manager returns from the MQDISC that called it with MQCC_FAILED and MQRC_API_EXIT_ERROR.
If the queue manager encounters an error while terminating the API exit function execution environment after invoking the last MQ_TERM_EXIT, the queue manager returns from the MQDISC call that invoked MQ_TERM_EXIT with MQCC_FAILED and MQRC_API_EXIT_TERM_ERROR
The interface to this function is:
MQ_TERM_EXIT (&ExitParms, &ExitContext, &CompCode, &Reason)
where the parameters are:
If the completion code is MQCC_OK, the only valid value is:
If the completion code is MQCC_FAILED, the exit function can set the reason code field to any valid MQRC_* value.
The CompCode and Reason returned to the application depend on the value of the ExitResponse field in MQAXP.
The queue manager logically defines the following variables:
MQAXP ExitParms; /* Exit parameter structure */ MQAXC ExitContext; /* Exit context structure */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_TERM_EXIT (&ExitParms, &ExitContext, &CompCode, &Reason)
Your exit must match the following C function prototype:
void MQENTRY MQ_TERM_EXIT ( PMQAXP pExitParms, /* Address of exit parameter structure */ PMQAXC pExitContext, /* Address of exit context structure */ PMQLONG pCompCode, /* Address of completion code */ PMQLONG pReason); /* Address of reason code qualifying completion code */
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
chinvoke |