In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the example analysis of Amazon SQS triggering AWS Lambda and retry / DLQ, which is very detailed and has certain reference value. Interested friends must read it!
Amazon announced in June 2018 that it can be set to use SQS to trigger Lambda,SQS, which is no longer used solely in ECS services or for scaling control. Here's a try of Lambda driven by SQS, and the elements you should pay attention to.
If you first write Lambda in Java, AWS adds the com.amazonaws.services.lambda.runtime.events.SQSEvent class in the com.amazonaws:aws-lambda-java-events:2.20 version, but this version of aws-lambda-java-events is limited because the SQSEvent.SQSMessage class is private, which makes it impossible to get the record data in the SQSEvent.
/ / the following operation code cannot be compiled because SQSEvent.SQSMessage is private and inaccessible
SQSEvent.SQSMessage sqs = sqsEvent.getRecords () .get (0)
SqsEvent.getRecords (). Get (0). GetBody ()
If Java uses SQS to drive Lambda, at least the com.amazonaws:aws-lambda-java-events:2.2.1 version is required, and SQSEvent.SQSMessage has since become public. This version was uploaded to the official central warehouse of Maven in June 2018, and this is the SQS-triggered Lambda that can really be used to write Java.
At the same time, this article is also a very important supplement to the above AWS Lambda retry and Dead letter queue (DLQ). The retry mechanism of Lambda triggered by SQS and the content related to DLQ will also be verified here.
The above is all the content of the article "Amazon SQS triggers AWS Lambda and retry / DLQ example Analysis". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.