Can multiple Lambdas subscribe to SQS?

0

I've an SQS queue set up with multiple Lambdas configured as triggers. While this is allowed by AWS's it's not clear what the intended behavior is. For example, is one message pulled off the queue and sent to each Lambda? or only one lambda will get the message

Pascal
질문됨 7달 전938회 조회
3개 답변
2

Only one of the functions will handle each message. If you want multiple functions to handle the messages, send them to SNS and then subscribe the different functions to the topic either directly, or using different queues. One queue per function.

profile pictureAWS
전문가
Uri
답변함 7달 전
profile picture
전문가
검토됨 7달 전
  • Thank You for sharing the details

0

Hi, Another possible pattern in your use case may be to trigger a Step Function from SQS and then have this Step Function orchestrate (parallel / sequential) the multiple lambdas if all of them need to run on each message.

See https://docs.aws.amazon.com/step-functions/latest/dg/sample-project-express-high-volume-sqs.html

The context of the Step Functions is a nice way to share the message across the various lambdas

Best,

Didier

profile pictureAWS
전문가
답변함 7달 전
0

Another way to have multiple Lambda functions (or other subscribers) receive the same message is to use Kinesis instead of SQS. Note that the cost will likely be higher and there are lower throughput limits but depending on what you want to do it might be suitable.

profile pictureAWS
전문가
답변함 7달 전

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

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

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

관련 콘텐츠