WildFly HornetQ Message Redelivery on Failure and the Dead Letter Queue

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

If HornetQ fails to deliver a message, its default behavior is to retry delivery to that destination for a set number of times, until the delivery succeeds. If all subsequent redelivery attempts fail, HornetQ will send the message to a configurable Dead Letter Queue.

Configuration

Redelivery behavior, which consists of maximum redelivery attempts before the message is sent to the Dead Letter Queue, redelivery delay and the address of the Dead Letter Queue itself, is configurable on a per-address basis.

...
<address-settings>
    <address-setting match="#">
        <dead-letter-address>jms.queue.DLQ</dead-letter-address>
        <redelivery-delay>0</redelivery-delay>
        <max-delivery-attempts>10</max-delivery-attempts>
        ...
    </address-setting>
</address-settings>
...

dead-letter-address

The address of the "Dead Letter Queue". It can also be a topic.

max-delivery-attempts

The default redelivery attempt count, if not specified in configuration, is 10.

If -1 or 0, the delivery is attempted forever.