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
已提问 4 个月前222 查看次数
1 回答
0
已接受的回答
  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
已回答 4 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则