How To Detect BatchItemFailure support from Lambda SQS Event

0

Hi Everyone,

When processing an SQS event with AWS Lambda, I want to know if the lambda function I am running (or the event source mapping more accurately) supports batch item failures. Is there a way to know from the SQS event?

Knowing this would let my Lambda function return a response that is appropriate for the event source mapping.

Until now I was running with an event source mapping that did not have batch item failures enabled (by mistake) and lost many messages as a result :-(

Thanks, Mo

1개 답변
0

No. The event object does not contain any specific information to let you know if the event source mapping supports partial failure response or not. You will need either to make sure you configure your event sources correctly :) or call the get_event_source_mapping API, which I do not recommend as it will probably throttle and will add latency.

profile pictureAWS
전문가
Uri
답변함 2년 전

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

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

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