Search code examples
activemq-artemis

Purge message from expiry queue


In ActiveMQ Artemis, while sending message I'm setting expiry. When message are not processed from expiry queue with 48 hrs, is there a way I can clear them?


Solution

  • Try using the <expiry-delay> address setting on the actual expiry address and unsetting the <expiry-address> which means expired messages will just be dropped. For example, if your expiry address is named ExpiryAddress then you'd have an address setting like this:

    <address-setting match="ExpiryAddress">
       <expiry-address/>
       <expiry-delay>172800000</expiry-delay> <!-- 48 hours in milliseconds -->
    </address-setting>
    

    See more in the documentation.