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

Provide a way to access Message Attributes in SnsMessage/SnsNotification #2716

Closed
1 task
GouthamiKondakindi opened this issue Mar 2, 2022 · 5 comments
Closed
1 task
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.

Comments

@GouthamiKondakindi
Copy link

GouthamiKondakindi commented Mar 2, 2022

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

  • I may be able to implement this feature request

AWS Java SDK version used

1.12.167

JDK version used

1.8.0_172

Operating System and version

macos

@GouthamiKondakindi GouthamiKondakindi added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 2, 2022
@debora-ito
Copy link
Member

I think it's the same ask we had in the past here: #2599.

If so, this has greater chance to be supported in the Java SDK v2.
Let us know if you have further questions.

@debora-ito debora-ito added response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. duplicate This issue is a duplicate. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 3, 2022
@GouthamiKondakindi
Copy link
Author

Hi @debora-ito, we current use v1 and we don't plan to upgrade to v2 yet because it's going to be a huge upgrade for us. If this isn't going to be supported in v1, my only option is to create my own custom object that extends SnsNotification.java and includes "MessageAttributes"? Is there no way to add this support in v1 sdk?

@github-actions github-actions bot removed the response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. label Mar 3, 2022
@debora-ito
Copy link
Member

We understand that upgrading is not an easy task, but v1 features have very low chances to be prioritized in favor of Java SDK v2 feature work.

The SNS Message Manager is not available yet in v2, you can track the progress and give a 👍 in the specific ask about Message Attributes here: aws/aws-sdk-java-v2#1302 (comment)

@debora-ito debora-ito added the closing-soon This issue will close in 2 days unless further comments are made. label Mar 3, 2022
@GouthamiKondakindi
Copy link
Author

Thanks @debora-ito . Closing this issue.

@github-actions
Copy link

github-actions bot commented Mar 3, 2022

COMMENT VISIBILITY WARNING

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants