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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠