This section provides some general guidance to help you to plan your exits, particularly related to handling errors and unexpected events.
If an exit function abnormally terminates after a destructive, out of syncpoint, MQGET call but before the message has been passed to the application, the exit handler can recover from the failure and pass control to the application. In this case, the message might be lost. This is similar to what happens when an application fails immediately after receiving a message from a queue.
The MQGET call might complete with MQCC_FAILED and MQRC_API_EXIT_ERROR.
If a before API call exit function terminates abnormally, the exit handler can recover from the failure and pass control to the application without processing the API call. In this event, the exit function must recover any resources that it owns.
If chained exits are in use, the after API call exits for any before API call exits that had successfully been driven can themselves be driven. The API call might fail with MQCC_FAILED and MQRC_API_EXIT_ERROR.
The following diagram shows the points (eN) at which errors can occur. It is only an example to show how exits behave and should be read together with the following table. In this example, two exit functions are invoked both before and after each API call to show the behavior with chained exits.
Application ErrPt Exit function API call ----------- ----- ------------- -------- Start MQCONN --> e1 MQ_INIT_EXIT e2 before MQ_CONNX_EXIT 1 e3 before MQ_CONNX_EXIT 2 e4 --> MQCONN e5 after MQ_CONNX_EXIT 2 e6 after MQ_CONNX_EXIT 1 e7 <-- MQOPEN --> before MQ_OPEN_EXIT 1 e8 before MQ_OPEN_EXIT 2 e9 --> MQOPEN e10 after MQ_OPEN_EXIT 2 e11 after MQ_OPEN_EXIT 1 e12 <-- MQPUT --> before MQ_PUT_EXIT 1 e13 before MQ_PUT_EXIT 2 e14 --> MQPUT e15 after MQ_PUT_EXIT 2 e16 after MQ_PUT_EXIT 1 e17 <-- MQCLOSE --> before MQ_CLOSE_EXIT 1 e18 before MQ_CLOSE_EXIT 2 e19 --> MQCLOSE e20 after MQ_CLOSE_EXIT 2 e21 after MQ_CLOSE_EXIT 1 e22 <-- MQDISC --> before MQ_DISC_EXIT 1 e23 before MQ_DISC_EXIT 2 e24 --> MQDISC e25 after MQ_DISC_EXIT 2 e26 after MQ_DISC_EXIT 1 e27 <-- end
The following table lists the actions to be taken at each error point. Only a subset of the error points have been covered, as the rules shown here can apply to all others. It is the actions that specify the intended behavior in each case.
ErrPt | Description | Actions |
---|---|---|
e1 | Error while setting up environment setup. |
|
e2 | MQ_INIT_EXIT function completes with:
|
|
e3 | Before MQ_CONNX_EXIT 1 function
completes with:
|
|
e4 | Before MQ_CONNX_EXIT 2 function
completes with:
|
|
e5 | MQCONN call fails. |
|
e6 | After MQ_CONNX_EXIT 2 function
completes with:
|
|
e7 | After MQ_CONNX_EXIT 1 function
completes with:
|
|
e8 | Before MQ_OPEN_EXIT 1 function
completes with:
|
|
e9 | Before MQ_OPEN_EXIT 2 function
completes with:
|
|
e10 | MQOPEN call fails |
|
e11 | After MQ_OPEN_EXIT 2 function
completes with:
|
|
e25 | After MQ_DISC_EXIT 2 function
completes with:
|
|
If the ExitResponse field is set to a value other than one of the supported values, the following actions apply:
If an exit function sets the ExitResponse2 field to a value other than one of the supported values, a value of MQXR2_DEFAULT_CONTINUATION is assumed instead.
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
csqzal10102 |