-
Notifications
You must be signed in to change notification settings - Fork 421
Feature request: Support for large SQS payloads in Event Data Source Classes #5157
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
Comments
@plondino Thanks for opening the issue – we have this in the Java version of Powertools for AWS Lambda already, so it seems like it would be a good fit for future releases. We're currently paused for the v3 release next week, but we'll look into this when we can. |
@sthulb looks interesting can i try this feature request |
Hey @shubhamsugara22 , we'll research more about this, and come back to you as soon as I have an update. |
Hello @plondino and @shubhamsugara22! If I understand correctly, this sqs-extended-client library implements the same interface/idea as the https://github.com/awslabs/amazon-sqs-java-extended-client-lib library and makes it interoperable because the payload body contains the same point class as Java: If this is true, what we could improve in this experience? from aws_lambda_powertools.utilities.data_classes import SQSEvent, event_source
import boto3
s3_client = boto3.client("s3")
@event_source(data_class=SQSEvent)
def lambda_handler(event: SQSEvent, context):
for record in my_event.records:
body = record.json_body
if "com.amazon.sqs.javamessaging.MessageS3Pointer" in body:
s3_bucket_name = record.json_body[1]["s3BucketName"]
s3_key = record.json_body[1]["s3Key"]
s3_file = s3.get_object(Bucket="s3_bucket_name", Key=s3_key)
You mean that if the message container We currently support accessing the message body and getting the keys, maybe we can think of a class for that to access it as an object, but getting the file directly from S3 I would like to hear more about this idea. Thanks |
Since we haven't heard back, we'll be closing it for now. Please don't hesitate to open a new one or start a new discussion if you have any updates or further thoughts. We appreciate your input! |
|
Use case
AWS has support for large payloads in SQS using the extended client library: https://pypi.org/project/sqs-extended-client/ - However there's still a fair amount of boilerplate when reacting to the event in a lambda on the receiving end to unwrap the message, check if it's a large payload message, and retrieve the payload from S3.
Solution/User Experience
This seems like an ideal use case for Powertools to reduce the boilerplate code and be able to unwrap an SQS, check for large payload support and retrieve the message as part of the receipt of the message.
Example payload:
Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: