Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve SQS interoperability#36525

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
chalasr merged 1 commit intosymfony:masterfromjderusse:sqs-interop
Apr 23, 2020
Merged

Conversation

jderusse
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
TicketsNA
LicenseMIT
Doc PRNA

The Symfony Messenger component provides a SerializerInterface to encode/decode theEnvelope, this can be used to improve the Interoperability (seearticle from jolicode (french))

Sadly, the current implementation of SQS adapter json_encode the elements of theEnvelope (string body +string[] headers) and store everything in the SQS messageBody. That partially defect the interoperability: 3rd party have to also wrap (unwrap) message form json_encoded Body.

This PR leverage the AWS SQSBody andMessageAttribute properties to store message information:

# beforeSQS Message:Body:{"body": "hello world", "headers": {"foo": "bar"}}MessageAttributes:{}# afterSQS Message:Body:hello worldMessageAttributes:foor:bar

Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Tests are broken :)

@jderusse
Copy link
MemberAuthor

tests are broken because the FakeSqs service does not support MessageAttributes....iain/fake_sqs#59

I'm looking for an alternative testing image

Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Remaining failures are unrelated

@chalasr
Copy link
Member

Thank you@jderusse.

@chalasrchalasr merged commit83b37e8 intosymfony:masterApr 23, 2020
@jderussejderusse deleted the sqs-interop branchApril 23, 2020 09:11
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
@fabpotfabpot mentioned this pull requestMay 5, 2020
@Swahjak
Copy link

@jderusse@chalasr is it possible this introduced the following issue:

Error: "HTTP 400 returned for "https://sqs.eu-west-1.amazonaws.com/".\n\nCode:    InvalidParameterValue\nMessage: Message (user) attribute name contains invalid non-alphanumeric character '#x5C'. You can use only alphanumeric characters, hyphens (-), underscores (_), or periods (.).\nType:    Sender\nDetail:  \n

When trying to send a message that is serialized (using the Symfony serializer) to:

array:2 [  "body" => "{"id":9948}"  "headers" => array:3 [    "type" => "Topper\Bundle\Magento2Bundle\Messenger\Message\ProductUpdatedMessage"    "X-Message-Stamp-Symfony\Component\Messenger\Stamp\BusNameStamp" => "[{"busName":"event.bus"}]"    "Content-Type" => "application/json"  ]

Trying to get a proper description going before opening an issue.

fabpot added a commit that referenced this pull requestJun 3, 2020
This PR was squashed before being merged into the 5.1 branch.Discussion----------Fix invalid char in SQS Headers| Q             | A| ------------- | ---| Branch?       | 5.1| Bug fix?      | yes| New feature?  | no| Deprecations? | yes| Tickets       |#36525 (comment)| License       | MIT| Doc PR        | /From [Amazon documnetation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html) header's name have constraints:- only `a-zA-Z0-9_\.-` + not start/end with a `.`- 256 charThis PR serialize ALL headers in a single SQS Attribute.Commits-------76a18b0 Fix invalid char in SQS Headers
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fabpotfabpotfabpot approved these changes

@chalasrchalasrchalasr approved these changes

@srozesrozeAwaiting requested review from sroze

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

6 participants
@jderusse@chalasr@Swahjak@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp