-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fix invalid char in SQS Headers #37038
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
Conversation
$headers = \json_decode($attributes[self::MESSAGE_ATTRIBUTE_NAME]->getStringValue(), true); | ||
unset($attributes[self::MESSAGE_ATTRIBUTE_NAME]); | ||
} | ||
foreach ($attributes as $name => $attribute) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is need for BC compatibility for people that previously successfully encoded message without special char
'StringValue' => $value, | ||
]); | ||
} | ||
$parameters['MessageAttributes'][self::MESSAGE_ATTRIBUTE_NAME] = new MessageAttributeValue([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make inter-operability harder with other tools publishing or reading with SQS. Wouldn't it be better to keep setting attributes directly when their name are valid SQS attribute names ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea
Thank you @jderusse. |
]); | ||
} | ||
|
||
dd($parameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…t (sstok) This PR was merged into the 5.1 branch. Discussion ---------- [Messenger/AmazonSqsBridge] Fixed left-over debug statement | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | | Deprecations? | no | Tickets | Related to #37038 | License | MIT | Doc PR | I noticed whats properly a left-over debugging statement that blocks the code from further execution. /cc @jderusse can you check this (thanks). Commits ------- 8b827e4 Fixed left-over debug statement
From Amazon documnetation header's name have constraints:
a-zA-Z0-9_\.-
+ not start/end with a.
This PR serialize ALL headers in a single SQS Attribute.