-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to use SQS to trigger Lambda #421
Comments
This might help; https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html |
@victormacko I'm working on integrating Symfony Messenger. I'm interested, did you use Messenger or no library? |
Yes, i've used messenger, with the following packages to get SNS happening;
The changes between SNS and SQS are pretty minimal for receiving messages -- just the 'bin/consume' handler needs to be able to adjusted for the different JSON structure. There's a good article on it here which I followed; http://developer.happyr.com/symfony-messenger-on-aws-lambda I think in theory you could get away with the extra packages if you only wanted lambda to 'receive' SQS/SNS rather than using $messenger->dispatch to add back to SNS/SQS. In terms of hooking lambda to SQS, you just need to give the lambda function some extra permissions, and setup the trigger on the SQS queue ... there's more details here which i've followed for SQS; It's worth mentioning that setting up a dead-letter-queue is a good idea too -- if the lambda PHP fn throws and error, the queue will automatically re-try sending it to lambda until you remove the trigger... a friend's already gotten a nasty surprise in the form of a big bill $$ from that mistake! |
I've improved the documentation in 1.0 with a short example. There's also https://serverless-visually-explained.com/ that includes more complete examples. |
This topic has been brought up multiple times and I realized that we have no "official" issue for this.
Here is a good article that will help cover the details in the documentation article to create: https://lumigo.io/blog/sqs-and-lambda-the-missing-guide-on-failure-modes/
The text was updated successfully, but these errors were encountered: