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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南