The sample DLQ handler amqsdlq

In addition to the dead-letter queue handler invoked using the runmqdlq command, IBM® MQ provides the source of a sample DLQ handler amqsdlq with a function that is similar to that provided by runmqdlq.

You can customize amqsdlq to provide a DLQ handler that meets your requirements. For example, you might decide that you want a DLQ handler that can process messages without dead-letter headers. (Both the default DLQ handler and the sample, amqsdlq, process only those messages on the DLQ that begin with a dead-letter header, MQDLH. Messages that do not begin with an MQDLH are identified as being in error, and remain on the DLQ indefinitely.)

MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

In IBM MQ for Windows, the source of amqsdlq is supplied in the directory:

MQ_INSTALLATION_PATH\tools\c\samples\dlq
and the compiled version is supplied in the directory:

MQ_INSTALLATION_PATH\tools\c\samples\bin

In IBM MQ for UNIX and Linux® systems, the source of amqsdlq is supplied in the directory:

MQ_INSTALLATION_PATH/samp/dlq

and the compiled version is supplied in the directory:

MQ_INSTALLATION_PATH/samp/bin

[MQ 9.2.3 Jul 2021]A built version of the sample program, named amqsdlqc, is included. You can use this to connect to a remote queue manager in client mode. To make use of amqsdlqc you must set one of the environment variables MQSERVER , MQCHLLIB , or MQCHLTAB to identify how to connect to the queue manager. For example:
 export MQSERVER="SYSTEM.DEF.SVRCONN/TCP/myappliance.co.uk(1414)"