Skip to content

Sqsd doesn't forward "MessageAttributes"  #2

@andysmchk

Description

@andysmchk

Hello, I've noticed a bug with receiving X-Aws-Sqsd-Attr- headers, they are just missed.
Looks like "MessageAttributes" were ignored.

Suggestion

Sqsd\Sqsd::collectMessageHeaders() excepts a wrong format of "MessageAttributes", according to the aws-sdk version from composer.json.
Actual format:

"MessageAttributes": {
        "PostalCode": {
          "DataType": "String",
          "StringValue": "ABC123"
        },
        "City": {
          "DataType": "String",
          "StringValue": "Any City"
        }
      }

Line 125 of that class contains redundant foreach construction

foreach ($message['MessageAttributes'] as $messageAttribute) {
    foreach ($messageAttribute as $messageAttributeName => $messageAttributeValues) {

After removing it 'MessageAttributes' are passed as expected.

foreach ($message['MessageAttributes'] as $messageAttributeName => $messageAttributeValues) {

Please let me know if i can help you to resolve this issue.
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions