Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-9520

Cannot configure address to never expire its messages

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • None
    • Low

      Suppose we want to configure an address so that its messages never expire, despite whatever timeToLive was set by their producer.

      From the docs, an expiry time of 0 means to never expire, so setting max-expiry-delay to 0 should be sufficient. But this has no effect. Neither does also setting it along with min-expiry-delay to 0.

      A hacky way to do this is set the address's expiryAddress to itself, but I can only assume this would have a performance hit if the broker needs to reprocess many of the messages every expiration.

      The simplest way is to simply set the min-expiry-delay to a very large number, perhaps the max signed long value. But it would be more elegant for max-expiry-delay of 0 to have the same behavior as an incoming message with an expiry of 0.

      To reproduce this, use the existing examples/features/standard/expiry project and add max-expiry-delay as 0 to the exampleQueue address setting and remove the <expiry-address> tag for good measure, e.g.:

      <address-settings>
         <address-setting match="exampleQueue">
            <max-expiry-delay>0</max-expiry-delay>
         </address-setting>
      </address-settings>

      We expect the message to remain in exampleQueue but instead it has expired.

      Sent message to exampleQueue: this is a text message
      Sleep a little bit to let the message expire...
      Received message from exampleQueue: null

      no-expiry.zip

      I tested this in both the latest AMQ 7.12.3 release and community Artemis 2.38.0.

              rhn-support-jbertram Justin Bertram
              rhn-gps-kherbert Keith Herbert
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: