0

I thought my problem was simple but after multiple attempts, it turned out to be more complicated than expected.

I'm using Amazon MQ for testing purposes and would just like all messages in all DLQs to be deleted automatically after X minutes.

The ActiveMQ documentation seems clear enough but impossible for me to apply. Even after 5 exchanges with the AWS support nothing happens. I'm going in circles trying dozens of configurations that never work. Here are some of the things I tried:

<policyEntry gcInactiveDestinations="true" inactiveTimoutBeforeGC="600000" producerFlowControl="false" queue="&gt;">
    <deadLetterStrategy>
        <sharedDeadLetterStrategy expiration="3000" processExpired="true" processNonPersistent="true"/>
    </deadLetterStrategy>
</policyEntry>

also

<policyEntry gcInactiveDestinations="true" inactiveTimoutBeforeGC="600000" queue="&gt;"/>
<policyEntry queue=" ActiveMQ.DLQ.Topic.FROM_CRM_NEW">
    <deadLetterStrategy>
        <individualDeadLetterStrategy expiration="3000"/>
    </deadLetterStrategy>
</policyEntry>

and also

<policyEntry gcInactiveDestinations="true" inactiveTimoutBeforeGC="600000" queue="&gt;">
    <deadLetterStrategy>
        <discarding expiration="3000"/>
    </deadLetterStrategy>
</policyEntry>

I have dozens of attempts with others configurations found on the Internet so I will not paste all here, but nothing works as expected and now I don't know how I can achieve this. Does someone here know how to do this?

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
Siick
  • 491
  • 1
  • 7
  • 23
  • So i have finally found that is totally impossible just by configuring the broker. Without the TTL being set at the message level from the producer, the messages weren't expired however once the TTL was set, as i observed, the messages were expired both from the producer target queue as well as from the DLQ. So you need to ensure that the message TTL has been set on the producer side. Without a TTL set, the messages won't be automatically sent to the DLQ where in turn they would receive a DLQ expiration time. – Siick May 31 '23 at 14:45

0 Answers0