Support for resolving S3-backed payloads in SNS non-raw messages (Fixes #175)#177
Open
danielferraz-git wants to merge 1 commit intoawslabs:masterfrom
Open
Conversation
…sages
This change introduces the ability for sync and async clients to resolve
large message payloads stored in S3 when the SQS message body is wrapped
in an SNS JSON envelope.
Key changes:
- Added payloadSupportFromSnsEnabled configuration option to opt-in
to SNS envelope processing.
- Implemented robust JSON manipulation using Jackson to resolve S3
pointers within the SNS "Message" field while preserving other
envelope attributes (e.g., Subject, Type, MessageId).
- Enhanced both AmazonSQSExtendedClient and
AmazonSQSExtendedAsyncClient to handle recursive payload resolution
within JSON-formatted message bodies.
- Added comprehensive unit and integration tests covering SNS envelope
preservation, pointer resolution, and standard SQS compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When SNS is configured to deliver messages to SQS without RawMessageDelivery enabled, it wraps the message body in a JSON envelope. This currently prevents the SQS Extended Client from resolving large payloads, as it expects the SQS message body itself to be the S3 pointer.
This PR introduces an opt-in feature to support SNS-wrapped messages. It allows the client to identify S3 pointers within the SNS "Message" field, resolve the actual payload from S3, and update the JSON envelope in-place. This ensures that all other SNS metadata (e.g., Subject, Type, MessageId, Timestamp) is preserved for the consumer.
Key Changes
Related Issue
Fixes #175