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

Fix message decoding #229

Merged
merged 1 commit into from
May 15, 2021
Merged

Conversation

cv65kr
Copy link

@cv65kr cv65kr commented Oct 6, 2020

In situation when subscribe a queue to an SNS topic with RawMessageDelivery option set up and we push encoded JSON

{\"default\": \"{\\\"test\\\": \\\"xxxx\\\"}\"}

The message is forwarded and contains protocol:

{
    "Messages": [
        {
            "MessageId": "b6e8402a-2798-405c-9955-78c10061610a",
            "ReceiptHandle": "b6e8402a-2798-405c-9955-78c10061610a#cbcbd29e-f9a8-4321-b3b0-3f5631ff1a8b",
            "MD5OfBody": "7b2d325f1dac7c79cf89e1fcde3b2e1d",
            "Body": "{\"default\": \"{\\\"test\\\": \\\"xxxx\\\"}\"}",
            "Attributes": {
                "ApproximateFirstReceiveTimestamp": "1601971148229",
                "SenderId": "1601971148229",
                "ApproximateReceiveCount": "1",
                "SentTimestamp": "1601971148229"
            },
            "MD5OfMessageAttributes": "d41d8cd98f00b204e9800998ecf8427e"
        }
    ]
}

AWS in receive-message don't show the protocol of message but only message.

Expected result:

{
    "Messages": [
        {
            "MessageId": "b6e8402a-2798-405c-9955-78c10061610a",
            "ReceiptHandle": "b6e8402a-2798-405c-9955-78c10061610a#cbcbd29e-f9a8-4321-b3b0-3f5631ff1a8b",
            "MD5OfBody": "7b2d325f1dac7c79cf89e1fcde3b2e1d",
            "Body": "{\"test\": \"xxxx\"}",
            "Attributes": {
                "ApproximateFirstReceiveTimestamp": "1601971148229",
                "SenderId": "1601971148229",
                "ApproximateReceiveCount": "1",
                "SentTimestamp": "1601971148229"
            },
            "MD5OfMessageAttributes": "d41d8cd98f00b204e9800998ecf8427e"
        }
    ]
}

@p4tin p4tin merged commit 3993d6e into Admiral-Piett:master May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants