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ヶ月前217ビュー
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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ