ExitReason (MQLONG)

This field specifies the reason why the exit is being called and is set on entry to the exit routine.

It is not used by the auto-definition exit. The following values are possible:

    MQXR_INIT
    Exit initialization.

    This value indicates that the exit is being invoked for the first time. It allows the exit to acquire and initialize any resources that it needs (for example: memory).

    MQXR_TERM
    Exit termination.

    This value indicates that the exit is about to be terminated. The exit should free any resources that it has acquired since it was initialized (for example: memory).

    MQXR_MSG
    Process a message.

    This value indicates that the exit is being invoked to process a message. This value occurs for channel message exits only.

    MQXR_XMIT
    Process a transmission.

    This value occurs for channel send and receive exits only.

    MQXR_SEC_MSG
    Security message received.

    This value occurs for channel security exits only.

    MQXR_INIT_SEC
    Initiate security exchange.

    This value occurs for channel security exits only.

    The security exit of the receiver is always invoked with this reason immediately after being invoked with MQXR_INIT, to give it the opportunity to initiate a security exchange. If it declines the opportunity (by returning MQXCC_OK instead of MQXCC_SEND_SEC_MSG or MQXCC_SEND_AND_REQUEST_SEC_MSG), the security exit of the sender is invoked with MQXR_INIT_SEC.

    If the security exit of the receiver does initiate a security exchange (by returning MQXCC_SEND_SEC_MSG or MQXCC_SEND_AND_REQUEST_SEC_MSG), the security exit of the sender is never invoked with MQXR_INIT_SEC; instead it is invoked with MQXR_SEC_MSG to process the message of the receiver. (In either case it is first invoked with MQXR_INIT.)

    Unless one of the security exits requests termination of the channel (by setting ExitResponse to MQXCC_SUPPRESS_FUNCTION or MQXCC_CLOSE_CHANNEL), the security exchange must complete at the side that initiated the exchange. Therefore, if a security exit is invoked with MQXR_INIT_SEC and it does initiate an exchange, the next time the exit is invoked it will be with MQXR_SEC_MSG. This happens whether there is a security message for the exit to process or not. There is a security message if the partner returns MQXCC_SEND_SEC_MSG or MQXCC_SEND_AND_REQUEST_SEC_MSG, but not if the partner returns MQXCC_OK or there is no security exit at the partner. If there is no security message to process, the security exit at the initiating end is re-invoked with a DataLength of zero.

    MQXR_RETRY
    Retry a message.

    This value occurs for message-retry exits only.

    MQXR_AUTO_CLUSSDR
    Automatic definition of a cluster-sender channel.

    This value occurs for channel auto-definition exits only.

    MQXR_AUTO_RECEIVER
    Automatic definition of a receiver channel.

    This value occurs for channel auto-definition exits only.

    MQXR_AUTO_SVRCONN
    Automatic definition of a server-connection channel.

    This value occurs for channel auto-definition exits only.

    MQXR_AUTO_CLUSRCVR
    Automatic definition of a cluster-receiver channel.

    This value occurs for channel auto-definition exits only.

    MQXR_SEC_PARMS
    Security parameters

    This value applies to security exits only and indicates that an MQCSP structure is being passed to the exit. For more information, see MQCSP - Security parameters

Note:

  1. If we have more than one exit defined for a channel, they are each invoked with MQXR_INIT when the MCA is initialized. Also, they are each invoked with MQXR_TERM when the MCA is terminated.
  2. For the channel auto-definition exit, ExitReason is not set if Version is less than MQCXP_VERSION_4. The value MQXR_AUTO_SVRCONN is implied in this case.

This is an input field to the exit.

Parent topic: Fields