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

Redelivery delay settings not applied to AMQP consumers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • None
    • amq-online
    • None
    • Hide

      Create broker with an address + queue 'myqueue'

      Send a single message to 'myqueue'.

      Run the following consumer:

      #!/usr/bin/python3
      
      from __future__ import print_function
      import optparse
      from proton.handlers import MessagingHandler
      from proton.reactor import Container
      import sys
      
      class Recv(MessagingHandler):
          def __init__(self, url, count):
              super(Recv, self).__init__(prefetch=0, auto_accept=False)
              self.url = url
              self.expected = count
              self.received = 0
      
          def on_start(self, event):
              self.receiver = event.container.create_receiver(self.url)
              self.receiver.flow(1)
      
          def on_message(self, event):
              print("Received", event)
              self.release(event.delivery)
              self.receiver.flow(1)
      
      try:
          Container(Recv("amqp://localhost:5672/myqueue", 1)).run()
      except KeyboardInterrupt: pass
      
      Show
      Create broker with an address + queue 'myqueue' Send a single message to 'myqueue'. Run the following consumer: #!/usr/bin/python3 from __future__ import print_function import optparse from proton.handlers import MessagingHandler from proton.reactor import Container import sys class Recv(MessagingHandler): def __init__(self, url, count): super (Recv, self).__init__(prefetch=0, auto_accept=False) self.url = url self.expected = count self.received = 0 def on_start(self, event): self.receiver = event.container.create_receiver(self.url) self.receiver.flow(1) def on_message(self, event): print( "Received" , event) self.release(event.delivery) self.receiver.flow(1) try : Container(Recv( "amqp: //localhost:5672/myqueue" , 1)).run() except KeyboardInterrupt: pass

      When configuring the broker (Artemis 2.10.1 or 2.11.0) with the following settings:

               <address-setting match="#">
                  <max-delivery-attempts>-1</max-delivery-attempts>
                  <redelivery-delay>10</redelivery-delay>
                  <redelivery-delay-multiplier>1.5</redelivery-delay-multiplier>
                  <max-redelivery-delay>10000</max-redelivery-delay>
               </address-setting>
            </address-settings>
      

      It seems that if an AMQP consumer acks with a modified or released (or reject where the AMQP configuration option to handle it the same way as released/modified is applied), the message is attempted to be redelivered immediately.

        1. broker.xml
          11 kB
          Ulf Lilleengen
        2. consumer.py
          0.7 kB
          Ulf Lilleengen
        3. producer.py
          2 kB
          Ulf Lilleengen

              rhn-support-jbertram Justin Bertram
              lulf@redhat.com Ulf Lilleengen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: