How To Remotely Administer the Dead Letter Queue Handler for the MQ Appliance
joelp01 100000PQHA Comments (2) Visits (11075)
By: Joel Pointer and Ashley Shea
The compiled version of the Dead Letter Queue (DLQ) handler that is shipped with MQ (runmqdlq) is not compiled to be used in client mode.
In order to remotely administer the DLQ, the supplied amqsdlq C source code must be compiled using the client libraries. Both the amqsdlq source code and the client libraries are included in the standalone MQ Client installation available from IBM Fix Central.
Here is a full example of the command that has been used to compile the sample program on a Linux RHEL 6 installation:
gcc -m64 -I /opt/mqm/samp/dlq amqodqka.c amqodqla.c amqodqma.c amqodqna.c amqodqoa.c amqodqpa.c amqodqua.c -o amqsdlqc -I /opt/mqm/inc -L /opt/mqm/lib64 -Wl,
Once compiled, the ODQ_MSG environment variable will need to be set to an appropriate .msg file. For example, the amqsdlq.msg that is shipped in the same directory as the amqsdlq source. The .msg file will need to be in the same directory as the compiled binary file.
For example: export ODQ_MSG=amqsdlq.msg
You will also need to configure your environment to allow the client application to resolve to the Queue Manager name provided. One way to achieve this is to use the MQSERVER environment variable. The environment variable has the following format: MQSE
For example: export MQSE
The amqsdlq application can be driven by stdin, however it is more common to pass in a "rules" file, containing information about how to handle messages on the DLQ. A simple example of a valid rules file would be:
Assuming that the Queue Manager is correctly configured on the server side, the DLQ application can now be run:
./amqsdlqc DEAD_LETTER_Q_NAME QM_NAME < /pat