Configure redelivery attempts with Lambda and Apache ActiveMQ

0

I've been trying to configure redeliveries with an ActiveMQ broker using the redelivery plugin. My goal is to have an event redelivered into a Lambda with a configurable delay between attempts, and a maximum redelivery count, moving the message into a Dead Letter Queue after hitting the maximum. This is my plugin config:

<redeliveryPlugin fallbackToDeadLetter="true" sendToDlqIfMaxRetriesExceeded="true">
      <redeliveryPolicyMap>
        <redeliveryPolicyMap>
          <redeliveryPolicyEntries>
            <redeliveryPolicy maximumRedeliveries="4" queue="SpecialQueue" redeliveryDelay="10000"/>
          </redeliveryPolicyEntries>
          <defaultEntry>
            <redeliveryPolicy maximumRedeliveries="4" redeliveryDelay="10000"/>
          </defaultEntry>
        </redeliveryPolicyMap>
      </redeliveryPolicyMap>

I've set a queue as the trigger for the lambda, and I'm receiving the messages, but when there's an error, it's causing many more retries than 4. I've also tried configuring the retries when pushing a message into the queue by using the ActiveMQ Web Console, but I'm still getting many more retries than I expect in the lambda. I've removed retries in the lambda asynchronous configuration (not sure if this affects MQ).

My understanding is that I might be conflicting Lambda retries with the queue redelivery, but I can't find anything to indicate that the queue only tried 4 times, and I don't know how to limit the lambda retries other than the Retry attempts option under Asynchronous Invocation. Any pointers to would be much appreciated.

Jose
asked 3 months ago193 views
1 Answer
0
Accepted Answer
  1. The invocation mode of Amazon MQ integrates lambda and is synchronous. So Retry attempts option does not matter in this case[1].
  2. Lambda does not support custom redelivery policies. The doc[2] indicates that:
    Instead, Lambda uses a policy with the default values from the Redelivery Policy page on the Apache ActiveMQ website[3], with maximumRedeliveries set to 5.
    The default value from the Redelivery Policy page on the Apache ActiveMQ website is 6 now. Anyway, the value is always greater than 4.
    [1]https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html
    [2]https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params
    [3]https://activemq.apache.org/redelivery-policy
profile picture
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions