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

GoAWS sends empty MessageAttributes & MD5OfMessageAttributes when none are supplied, breaking compatibiltiy with aws/aws-sdk-php #328

Open
zikeji opened this issue Oct 22, 2024 · 4 comments
Assignees

Comments

@zikeji
Copy link

zikeji commented Oct 22, 2024

Relevant issue: aws/aws-sdk-php#2827

When creating a message with no attributes, the message returned by receive message has an empty MessageAttributes object and a empty string for MD5OfMessageAttributes.

This can be reproduced with:

aws sqs send-message --queue-url http://goaws:4100/100010001000/default --message-body "test"
# {
#    "MD5OfMessageBody": "098f6bcd4621d373cade4e832627b4f6",
#    "MD5OfMessageAttributes": "",
#    "MessageId": "d9e27ccb-bbd7-4569-b00f-a6f6d91bdb37",
#    "SequenceNumber": ""
# }
aws sqs receive-message --queue-url http://goaws:4100/100010001000/default
# {
#    "Messages": [
#        {
#            "MessageId": "d9e27ccb-bbd7-4569-b00f-a6f6d91bdb37",
#            "ReceiptHandle": "d9e27ccb-bbd7-4569-b00f-a6f6d91bdb37#94880fdc-9092-4ef4-bbf6d950b2ddc966",
#            "MD5OfBody": "098f6bcd4621d373cade4e832627b4f6",
#            "Body": "test",
#            "Attributes": {
#                "ApproximateFirstReceiveTimestamp": "1729637818936",
#                "ApproximateReceiveCount": "1",
#                "SenderId": "100010001000",
#                "SentTimestamp": "1729637818936"
#            },
#            "MD5OfMessageAttributes": "",
#            "MessageAttributes": {}
#        }
#    ]
# }
@kojisaikiAtSony
Copy link
Contributor

It is related with jackson-ize process with empty map in go 🤔 We may need to add a condition somewhere to prevent map from being made carelessly.

@Admiral-Piett
Copy link
Owner

@zikeji I maaaay have gotten this with the 0.5.1 release. Would you mind checking when you have time and letting me know what you find? Thank you!

@zikeji
Copy link
Author

zikeji commented Nov 1, 2024

@Admiral-Piett Thanks for taking a look! Looks like half of it was resolved, the MessageAttributes property is no longer there as expected, however as MD5OfMessageAttributes is still present and an empty string it's still failing in aws-sdk-php.

@Admiral-Piett
Copy link
Owner

@zikeji Got it. I thought that might happen, but wanted to make sure I was on the right track. I think this should take care of it - #335. I'll get it in v0.5.2!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants