The API exit sample program

The sample API exit generates an MQI trace to a user-specified file with a prefix defined in the MQAPI_TRACE_LOGFILE environment variable.

For more information about API exits, see Writing and compiling API exits on Multiplatforms.

    Source
    amqsaxe0.c

    Binary
    amqsaxe


Configure for the sample exit

  1. Add the following to the qm.ini file.

      Platforms other than Windows
      ApiExitLocal:
      Sequence=100
      Function=EntryPoint
      Module= MQ_INSTALLATION_PATH/samp/bin/amqsaxe
      Name=SampleApiExit
      
      where MQ_INSTALLATION_PATH represents the directory where IBM MQ is installed.

      Windows
      ApiExitLocal:
      Sequence=100
      Function=EntryPoint
      Module= MQ_INSTALLATION_PATH\Tools\c\Samples\bin\amqsaxe
      Name=SampleApiExit
      
      where MQ_INSTALLATION_PATH represents the directory where IBM MQ is installed.

  2. Set the environment variable
    MQAPI_TRACE_LOGFILE=/tmp/MqiTrace
    
  3. Run the application.

    Output files are created in the /tmp directory with names like: MqiTrace.pid.tid.log

Parent topic: Use the sample programs on Multiplatforms