The difference is that the Lambda service is managing the pollers (and paying for them!) on your behalf.Īlthough these managed pollers are invisible to us, they still introduce failure modes that affect our application. However, SQS itself hasn’t changed – it is still very much a “poll-based” service. This seems true from the perspective of your function because you no longer have to poll SQS yourself. Since Lambda added SQS as an event source, there has been a misconception that SQS is now a “push-based” service. If so, congrats – you just sent a test SQS event which was captured and processed by your Lambda function! SQS Lambda: 4 Failure Modes and How to Handle Them You should see the message Execution result: succeeded. From the Event template drop down, select SQS. Step 5: Test your trigger by creating a test eventĪt the top right of the screen, select Configure test event. Under function configuration, in the Designer, scroll through the list of triggers on the left, and add the new SQS queue we created, TestMySQSLambda. Under Execution Role, select the role we defined earlier, SQSLambda. Edit the function and add basic function code, something like the below. In the AWS Console, navigate to AWS Lambda and create a new function named MySQSTriggerTest. Navigate to Amazon Identity and Access Management (IAM), and add the following policy to your Lambda execution role, naming it SQSLambda: Select the type Standard Queue and click Quick-Create Queue. In the AWS Console, navigate to Simple Queue Service, create a new SQS queue and name it TestMySQSLambda. It will show you how to set up your first Lambda function with an SQS trigger. This is abbreviated from the full tutorial by Adrian Hornsby. Quick Tutorial: Setting Up a Lambda Function with SQS Triggers Lambda may also add additional pollers as needed, which can incur additional cost. When Lambda makes SQS API calls, they are charged at the regular price.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |