The DLQ handler rules table on IBM i
The dead-letter queue handler rules table defines how the DLQ handler processes messages that arrive on the IBM i DLQ.
The DLQ handler rules table defines how the DLQ handler is to process messages that arrive on the DLQ. There are two types of entry in a rules table:
- The first entry in the table, which is optional, contains control data.
- All other entries in the table are rules for the DLQ handler to follow. Each rule consists of a pattern (a set of message characteristics) that a message is matched against, and an action to be taken when a message on the DLQ matches the specified pattern. There must be at least one rule in a rules table.
Each entry in the rules table comprises one or more keywords.
Control data
This section describes the keywords that we can include in a control-data entry in a DLQ handler rules table. Note the following:
- The default value for a keyword, if any, is underlined.
- The vertical line (|) separates alternatives. We can specify only one of these.
- All keywords are optional.
- INPUTQ ( QueueName|' ')
- The name of the DLQ we want to process:
- Any UDLMSGQ value (or *DFT) you specify as a parameter to the STRMQMDLQ command overrides any INPUTQ value in the rules table.
- If you specify a blank UDLMSGQ value as a parameter to the STRMQMDLQ command, the INPUTQ value in the rules table is used.
- If you specify a blank UDLMSGQ value as a parameter to the STRMQMDLQ command, and a blank INPUTQ value in the rules table, the system default dead-letter queue is used.
- INPUTQM ( QueueManagerName|' ')
- The name of the queue manager that owns the DLQ named on the INPUTQ keyword.
If we do not specify a queue manager, or you specify INPUTQM(' ') in the rules table, the system uses the default queue manager for the installation.
- RETRYINT ( Interval|60 )
- The interval, in seconds, at which the DLQ handler should attempt to reprocess messages on the DLQ that could not be processed at the first attempt, and for which repeated attempts have been requested. By default, the retry interval is 60 seconds.
- WAIT ( YES|NO|nnn )
- Whether the DLQ handler should wait for further messages to arrive on the DLQ when it detects that there are no further messages that it can process.
- YES
- Causes the DLQ handler to wait indefinitely.
- NO
- Causes the DLQ handler to terminate when it detects that the DLQ is either empty or contains no messages that it can process.
- nnn
- Causes the DLQ handler to wait for nnn seconds for new work to arrive before terminating, after it detects that the queue is either empty or contains no messages that it can process.
Specify WAIT (YES) for busy DLQs, and WAIT (NO) or WAIT ( nnn ) for DLQs that have a low level of activity. If the DLQ handler is allowed to terminate, re-invoke it using triggering.
We can supply the name of the DLQ as an input parameter to the STRMQMDLQ command, as an alternative to including control data in the rules table. If any value is specified both in the rules table and on input to the STRMQMDLQ command, the value specified on the STRMQMDLQ command takes precedence.
Note: If a control-data entry is included in the rules table, it must be the first entry in the table.
- DLQ rules (patterns and actions) on IBM i
A description of the patterns and actions for each of the IBM i dead-letter queue rules.- DLQ rules table conventions on IBM i
The IBM i dead-letter queue rules table must adhere to specific conventions regarding its syntax, structure, and contents.- Processing the DLQ rules table on IBM i
The dead-letter queue handler searches the rules table for a rule with a pattern that matches a message on the IBM i dead-letter queue.- Ensuring that all DLQ messages are processed on IBM i
The dead-letter queue handler keeps a record of all messages on the IBM i DLQ that have been seen but not removed.- An example DLQ handler rules table on IBM i
Example code for a dead-letter queue handler rules table on IBM i. This example rules table contains a single control-data entry and several rules.Parent topic: The dead-letter queue handler on IBM i