Put - MQ_PUT_EXIT

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:

    ExitParms (MQAXP) - input/output
    Exit parameter structure.

    ExitContext (MQAXC) - input/output
    Exit context structure.

    Hconn (MQHCONN) - input
    Connection handle.

    Hobj (MQHOBJ) - input/output
    Object handle.

    pMsgDesc (PMQMD) - input/output
    Pointer to message descriptor.

    pPutMsgOpts (PMQPMO) - input/output
    Pointer to put message options.

    BufferLength (MQLONG) - input/output
    Message buffer length.

    pBuffer (PMQBYTE) - input/output
    Pointer to message buffer.

    CompCode (MQLONG) - input/output
    Completion code, valid values for which are:

      MQCC_OK
      Successful completion.

      MQCC_WARNING
      Partial completion.

      MQCC_FAILED
      Call failed

    Reason (MQLONG) - input/output
    Reason code qualifying the completion 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.


C language invocation

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 */


Usage notes

  • Report messages generated by the queue manager skip the normal call processing. As a result, such messages cannot be intercepted by the MQ_PUT_EXIT function or the MQPUT1 function. However, report messages generated by the message channel agent are processed normally, and hence can be intercepted by the MQ_PUT_EXIT function or the MQ_PUT1_EXIT function. To be sure to intercepting all of the report messages generated by the MCA, both MQ_PUT_EXIT and MQ_PUT1_EXIT should be used.

Parent topic: Exit functions