Skip to content
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

Feature request: Support for large SQS payloads in Event Data Source Classes #5157

Open
2 tasks done
plondino opened this issue Sep 11, 2024 · 1 comment
Open
2 tasks done
Labels
feature New feature or functionality feature-request feature request help wanted Could use a second pair of eyes/hands

Comments

@plondino
Copy link

plondino commented Sep 11, 2024

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:

{
    "Records": [
        {
            "messageId": "4bdc116c-dda9-4344-bfb1-cf49a2bcdd68",
            "receiptHandle": "",
            "body": "[\"com.amazon.sqs.javamessaging.MessageS3Pointer\",{\"s3BucketName\":\"bucket_name\",\"s3Key\":\"s3_key\"}]",
            "attributes": {
                "ApproximateReceiveCount": "1",
                "SentTimestamp": "1726071666910",
                "SequenceNumber": "18888618420438511616",
                "MessageGroupId": "d57f6826-89c2-497e-b920-ec6dc5dff067",
                "SenderId": "user_id:[email protected]",
                "MessageDeduplicationId": "d39dc4b9-52eb-425e-be3a-c57649d59740",
                "ApproximateFirstReceiveTimestamp": "1726071666910"
            },
            "messageAttributes": {
                "SQSLargePayloadSize": {
                    "stringValue": "300000",
                    "stringListValues": [],
                    "binaryListValues": [],
                    "dataType": "Number"
                }
            },
            "md5OfMessageAttributes": "5db28f0fb9aab47287f040ec3714a262",
            "md5OfBody": "d7b208d9230692ec7d4ab5588266024c",
            "eventSource": "aws:sqs",
            "eventSourceARN": "arn:aws:sqs:us-east-1:123456789012:sqs_name",
            "awsRegion": "us-east-1"
        }
    ]
}

Alternative solutions

No response

Acknowledgment

@plondino plondino added feature-request feature request triage Pending triage from maintainers labels Sep 11, 2024
@plondino plondino changed the title Feature request: Support for sqs_extended_client in Event Data Source Classes Feature request: Support for large SQS payloads in Event Data Source Classes Sep 11, 2024
@sthulb
Copy link
Contributor

sthulb commented Sep 16, 2024

@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 sthulb added help wanted Could use a second pair of eyes/hands feature New feature or functionality and removed triage Pending triage from maintainers labels Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or functionality feature-request feature request help wanted Could use a second pair of eyes/hands
Projects
Development

No branches or pull requests

2 participants