1

Apache ActiveMQ offers the following setting to discard expired messages from a queue:

<address-setting match="exampleQueue">
   <expiry-delay>10</expiry-delay>
</address-setting>

Amazon MQ doesn't support address-setting as a configuration parameter. How can we set the expiration delay in Amazon MQ for a specific queue?

We know about the timeStampingBrokerPlugin, but that doesn't seem to be applicable to specific queues, only across all queues.

Christopher Peisert
  • 21,862
  • 3
  • 86
  • 117
pkout
  • 6,430
  • 2
  • 45
  • 55

1 Answers1

0

Amazon MQ supports the element policyEntry with attribute expireMessagesPeriod.

XML Schema definition

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://activemq.apache.org/schema/core" elementFormDefault="qualified" targetNamespace="http://activemq.apache.org/schema/core">
  ...
  <xs:element name="policyEntry">
    <xs:complexType>
      ...
      <xs:attribute name="expireMessagesPeriod" type="xs:long"/>

Example

<broker xmlns="http://activemq.apache.org/schema/core">
  <destinationPolicy>
    <policyMap>
      <policyEntries>
        <policyEntry queue=">" expireMessagesPeriod="30000">
          <!-- other policy settings -->
        </policyEntry>
      </policyEntries>
    </policyMap>
  </destinationPolicy>
  <!-- other broker settings -->
</broker>

Resources

Christopher Peisert
  • 21,862
  • 3
  • 86
  • 117