Provide a way to access Message Attributes in SnsMessage/SnsNotification #2716
Labels
closing-soon
This issue will close in 2 days unless further comments are made.
duplicate
This issue is a duplicate.
feature-request
A feature should be added or improved.
Describe the feature
Setup: A queue in SQS is subscribed to a topic in SNS with RawMessageDelivery=false
Usecase: When a message is published to the above topic and this message has some message attributes, when this message is forwarded to a queue, the message body that SQS receives will be in JSON format and this JSON contains "MessageAttributes".
Sample message that SQS receives in this case:
{
"Type": "Notification",
"MessageId": "dc1e94d9-56c5-5e96-808d-cc7f68faa162",
"TopicArn": "arn:aws:sns:us-east-2:111122223333:ExampleTopic1",
"Subject": "TestSubject",
"Message": "This is a test message.",
"MessageAttributes": {
"<Attribute 1>": {
"Type": "String",
"Value": "<Attribute 1 Value>"
},
"<Attribute 2>": {
"Type": "String"
"Value": "<Attribute 2 Value>"
}
}
"Timestamp": "2021-02-16T21:41:19.978Z",
"SignatureVersion": "1",
"Signature": "abc==",
"SigningCertURL": "<cert.pem>",
"UnsubscribeURL": ""
}
But I don't see this "MessageAttributes" in SnsNotification.java or SnsMessage.java. So, I don't have a way to map the message body that SQS receives to a Java object in the aws sdk.
Is your Feature Request related to a problem?
AWS sdk provides no way to parse the message that SQS received from SNS and extract "MessageAttributes" from it.
Proposed Solution
Add "MessageAttributes" to SnsNotification.java or SnsMessage.java
Describe alternatives you've considered
Alternative would be to create my own custom object to map the JSON and extract "MessageAttributes" from it.
Acknowledge
AWS Java SDK version used
1.12.167
JDK version used
1.8.0_172
Operating System and version
macos
The text was updated successfully, but these errors were encountered: