Here we describe the structure of the external control blocks, MQAXP and MQAXC.
The MQAXP structure is used as an input/output parameter to the API exit. MQAXP has the following C declaration:
typedef struct tagMQAXP { MQCHAR4 StrucId; /* Structure identifier */ MQLONG Version; /* Structure version number */ MQLONG ExitId; /* Exit Identifier */ MQLONG ExitReason; /* Exit invocation reason */ MQLONG ExitResponse; /* Response code from exit */ MQLONG ExitResponse2; /* Secondary response code from exit */ MQLONG Feedback; /* Feedback code from exit */ MQLONG APICallerType; /* MQSeries API caller type */ MQBYTE16 ExitUserArea; /* User area for use by exit */ MQCHAR32 ExitData; /* Exit data area */ MQCHAR48 ExitInfoName; /* Exit information name */ MQBYTE48 ExitPDArea; /* Problem determination area */ MQCHAR48 QMgrName; /* Name of local queue manager */ PMQACH ExitChainAreaPtr; /* Inter exit communication area */ MQHCONFIG Hconfig; /* Configuration handle */ MQLONG Function; /* Function Identifier */ };
The parameter list described below is passed when functions in an API exit are invoked:
MQAXP_STRUC_ID.The exit handler sets this field on entry to each exit function.
This field must be set by the exit function, to communicate to the queue manager the result of executing the exit function. The value must be one of the following:
This value can be set by all MQXR_* exit functions. ExitResponse2 is used to decide whether to invoke exit functions later in the chain.
This value can be set by all MQXR_* exit functions. The queue manager sets CompCode to MQCC_FAILED, and Reason to:
The values set can be altered by an exit function later in the chain.
ExitResponse2 is ignored; the queue manager continues processing as though MQXR2_SUPPRESS_CHAIN had been returned.
This value can be set only by an MQXR_BEFORE exit function. It bypasses the API call. If it is returned by the MQ_DATA_CONV_ON_GET_EXIT, data conversion is bypassed. The queue manager sets CompCode to MQCC_FAILED, and Reason to MQRC_SUPPRESSED_BY_EXIT, but the values set can be altered by an exit function later in the chain. Other parameters for the call remain as the exit left them. ExitResponse2 is used to decide whether to invoke exit functions later in the chain.
If this value is set by an MQXR_AFTER or MQXR_CONNECTION exit function, the queue manager continues processing as though MQXCC_FAILED had been returned.
This value can be set only by an MQXR_BEFORE exit function. It bypasses the API call. If it is returned by the MQ_DATA_CONV_ON_GET_EXIT, data conversion is bypassed. The exit function must set CompCode and Reason to the values to be returned to the application, but the values set can be altered by an exit function later in the chain. Other parameters for the call remain as the exit left them. ExitResponse2 is used to decide whether to invoke exit functions later in the chain.
If this value is set by an MQXR_AFTER or MQXR_CONNECTION exit function, the queue manager continues processing as though MQXCC_FAILED had been returned.
This value can be set only by the MQXR_BEFORE and MQXR_AFTER exit functions. It bypasses all subsequent invocations of exit functions belonging to this set of exits for this logical connection. This bypassing continues until the logical disconnect request occurs, when MQ_TERM_EXIT function is invoked with an ExitReason of MQXR_CONNECTION.
The exit function must set CompCode and Reason to the values to be returned to the application, but the values set can be altered by an exit function later in the chain. Other parameters for the call remain as the exit left them. ExitResponse2 is ignored.
If this value is set by an MQXR_CONNECTION exit function, the queue manager continues processing as though MQXCC_FAILED had been returned.
For information on the interaction between ExitResponse and ExitResponse2, and its affect on exit processing, see How queue managers process exit functions.
MQXR2_DEFAULT_CONTINUATIONon entry to a WebSphere MQ API call exit function. It can then be set to one of the values:
If ExitResponse is MQXCC_SUPPRESS_FUNCTION or MQXCC_SKIP_FUNCTION, bypass exit functions later in the MQXR_BEFORE chain and the matching exit functions in the MQXR_AFTER chain. Invoke exit functions in the MQXR_AFTER chain that match exit functions earlier in the MQXR_BEFORE chain.
Otherwise, invoke the next exit in the chain.
Bypass exit functions later in the MQXR_BEFORE chain and the matching exit functions in the MQXR_AFTER chain for this API call invocation. Invoke exit functions in the MQXR_AFTER chain that match exit functions earlier in the MQXR_BEFORE chain.
MQFB_NONE (0)before invoking the first function of the first exit in a chain.
Exits can set this field to any value, including any valid MQFB_* or MQRC_* value. Exits can also set this field to a user-defined feedback value in the range MQFB_APPL_FIRST to MQFB_APPL_LAST.
This field is aligned to a multiple of 4 MQLONGs.
Exits can also anchor any storage that they allocate from this area.
For each hconn, each exit in a chain of exits has a different ExitUserArea. The ExitUserArea cannot be shared by exits in a chain, and the contents of the ExitUserArea for one exit are not available to another exit in a chain.
For C programs, the constant MQXUA_NONE_ARRAY is also defined with the same value as MQXUA_NONE, but as an array of characters instead of a string.
The length of this field is given by MQ_EXIT_USER_AREA_LENGTH.
The length of this field is given by MQ_EXIT_DATA_LENGTH.
For C programs, the constant MQXPDA_NONE_ARRAY is also defined with the same value as MQXPDA_NONE, but as an array of characters instead of a string.
The exit handler always writes this area to the WebSphere MQ trace at the end of an exit, even when the function is successful.
The length of this field is given by MQ_EXIT_PD_AREA_LENGTH.
If the name of a queue manager supplied on an MQCONN or MQCONNX calls is blank, this field is still set to the name of the local or default queue manager.
The exit handler sets this field on entry to each exit function.
The length of this field is given by MQ_Q_MGR_NAME_LENGTH.
Refer to The exit chain area and exit chain area header (MQACH) for more details about how to use the exit chain area.
The exit handler sets this field to the correct value, on entry to each exit function, depending on the WebSphere MQ API call that resulted in the exit being invoked.
The processing performed by the queue manager on return from an exit function depends on both ExitResponse and ExitResponse2. Table 8 below summarizes the possible combinations and their effects for an MQXR_BEFORE exit function, showing:
For an MQXR_AFTER exit function:
For an MQXR_CONNECTION exit function:
In all cases, where an exit or the queue manager sets CompCode and Reason, the values set can be changed by an exit invoked later, or by the API call (if the API call is invoked later).
Value of ExitResponse | CompCode and Reason set by | Value of ExitResponse2 (default continuation) Chain | Value of ExitResponse2 (default continuation) API |
MQXCC_OK | exit | Y | Y |
MQXCC_SUPPRESS_EXIT | exit | Y | Y |
MQXCC_SUPPRESS_FUNCTION | queue manager | N | N |
MQXCC_SKIP FUNCTION | exit | N | N |
MQXCC_FAILED | queue manager | N | N |
The MQAXC structure is used as an input parameter to an API exit. MQAXC has the following C declaration:
typedef struct tagMQAXC { MQCHAR4 StrucId; /* Structure identifier */ MQLONG Version; /* Structure version number */ MQLONG Environment; /* Environment */ MQCHAR12 UserId; /* UserId associated with appl */ MQBYTE40 SecurityId /* Extension to UserId running appl */ MQCHAR264 ConnectionName; /* Connection name */ MQLONG LongMCAUserIdLength; /* long MCA user identifier length */ MQLONG LongRemoteUserIdLength; /* long remote user identifier length */ MQPTR LongMCAUserIdPtr; /* long MCA user identifier address */ MQPTR LongRemoteUserIdPtr; /* long remote user identifier address */ MQCHAR28 ApplName; /* Application name */ MQLONG ApplType; /* Application type */ MQPID ProcessId; /* Process identifier */ MQTID ThreadId; /* Thread identifier */ };
The parameters to MQAXC are:
The exit handler sets this field on entry to each exit function.
The exit handler sets this field on entry to each exit function. The length of this field is given by MQ_USER_ID_LENGTH.
The length of this field is given by MQ_CONN_NAME_LENGTH.
When MCA connects to the queue manager this field is set to the length of the long MCA user identifier (or zero if there is no such identifier).
When MCA connects to the queue manager this field is set to the length of the long remote user identifier. Otherwise this field will be set to zero
When MCA connects to the queue manager this field is set to the address of the long MCA user identifier (or to a null pointer if there is no such identifier).
When MCA connects to the queue manager this field is set to the address of the long remote user identifier (or to a null pointer if there is no such identifier).
The rules for generating the ApplName are the same as for generating the default name for an MQPUT.
The value of this field is found by querying the operating system for the program name. Its length is given by MQ_APPL_NAME_LENGTH.
The value is MQAT_DEFAULT for the platform on which the application is compiled, or it equates to one of the defined MQAT_* values.
The exit handler sets this field on entry to each exit function.
Where applicable, the exit handler sets this field on entry to each exit function.
Where applicable, the exit handler sets this field on entry to each exit function.
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
chextcont |