Reputation: 1
i have set TTL of persistent messages in a queue as 5 seconds, the messages did expire and landed in the DLQ, however, i notice that the expired messages will only appear in the DLQ onlyafter 10+ to 20+ seconds at random after it was sent even though the TTL is set as 5 seconds. Is there a way to configure such that expired messages are moved to DLQ queue immediately after it expires ?
Upvotes: 0
Views: 744
Reputation: 18356
In the absence of some consumer pulling messages off the Queue and the broker seeing prior to dispatch that the message has expired there is a periodic task that is run to scan for expired messages that are in memory (those paged to disk will be expired when paged back in).
You can configure the scan to run more often but it will have an impact on broker performance. The option is documented in the ActiveMQ Destination Policy options for Queue only values.
Upvotes: 1