Messages did not get processed by the lambda when the sqs acts as event source

0
  • I have two lambdas and one sqs fifo queue.
  • First lambda was used to add all the messages to the queue.
  • And when the message meets certain pattern in the sqs queue, the second lambda will be trigged to process all the filtered data in the queue.

BUT, if I send multiple messages into the queue, say 4 messages in 3 second, then very likely only 2 messages will get processed by the second lambda, although all the 4 messages meet my filter pattern.

Currently I changed the batch size to 1, just in case, but nothing changed. Don't know why it happened, it looks like the lambda is very unstable. Any help will be appreciated.

  • Hi Sorry did not see your answer. Yes in a basic plan you can use only one Lambda... maybe try launching a request ++

1개 답변
0

Ok so there might be possibility of have two consumers over here like two functions added to the queue to consume the message. when you have multiple consumers added to the SQS then message gets polled from the queue. Now once a message is processed by first lambda function then lambda service will delete the message from the queue which is why the other function is not getting the other message.

Suggestion would be to use sqs sns fanout option where you will have two queues for each lambda functions and queues will be added as destination/subscriber to an SNS topic. So you will have to send message to the topic which will get forwarded to both the queues and then to the lambda functions.

Shivam
답변함 일 년 전

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

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

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

관련 콘텐츠