-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] [Sqs] Add AddFifoStamp
middleware
#48095
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
8c0a310
to
161d613
Compare
Hey! I think @filkaris has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
Hello there ! I'll have some time soon to write some documentation but I'd like to be sure that the feature is interesting :D |
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.
Thank you
I like this PR.
What are the pros/cons to use one interface instead of two? (and make the return type nullable)
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Middleware/WithMessageGroupId.php
Outdated
Show resolved
Hide resolved
Hi @Nyholm ! In fact, deduplication is "optionnal" in sqs world. For example in our situation we rarely use it. According to the documentation
So 2 interfaces reduce the boilercode to write by the end user (aka empty method deduplicationId) |
Yeah, true. Thank you Please add a doc block and I am super happy with this PR. |
161d613
to
ca2d0d7
Compare
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Middleware/WithMessageGroupId.php
Outdated
Show resolved
Hide resolved
AddFifoStamp
middleware
AddFifoStamp
middlewareAddFifoStamp
middleware
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.
Can you please add a before/after to the description of your PR? How can one do today, and your proposal?
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Middleware/AddFifoStamp.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Middleware/AddFifoStampTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Middleware/AddFifoStampTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Middleware/AddFifoStampTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Middleware/AddFifoStampTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Middleware/AddFifoStampTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Middleware/AddFifoStampTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Middleware/AddFifoStampTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Middleware/WithMessageDeduplicationId.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Middleware/AddFifoStamp.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Middleware/AddFifoStamp.php
Outdated
Show resolved
Hide resolved
...ny/Component/Messenger/Bridge/AmazonSqs/Middleware/SupportsMessageDeduplicationInterface.php
Outdated
Show resolved
Hide resolved
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.
One minor comment and GTM!
...mfony/Component/Messenger/Bridge/AmazonSqs/Middleware/MessageDeduplicationAwareInterface.php
Outdated
Show resolved
Hide resolved
...mfony/Component/Messenger/Bridge/AmazonSqs/Middleware/MessageDeduplicationAwareInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Bridge/AmazonSqs/Middleware/AddFifoStamp.php
Outdated
Show resolved
Hide resolved
...mfony/Component/Messenger/Bridge/AmazonSqs/Middleware/MessageDeduplicationAwareInterface.php
Outdated
Show resolved
Hide resolved
One last thing: please update the PR description to show how the middleware could be enabled. |
fe008fa
to
707b5a4
Compare
This PR was merged into the 6.4 branch. Discussion ---------- DX: nullable_type_declaration | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a | License | MIT https://cs.symfony.com/doc/rules/language_construct/nullable_type_declaration.html#example-1 requested in #48095 (comment) I do not put this rule in ruleset, as it requires PHP 8 - if you want to move it to ``@Symfony`` ruleset, let me know There is concern how to have this rule configured and have PHPUnit bridge supporting 7.4, but I think I will leave it unresolved for now. Commits ------- 6aff9d9 DX: nullable_type_declaration
707b5a4
to
c424da4
Compare
Thank you @tyx. |
Currently it is not very easy to use fifo stamp as you need to go down to the envelope when you often handle only message in your app.
We also think that the message should be responsible to choose its own groupId.
So we come with this very simple middleware and 2 interfaces. We use it in our own system since 3 months.
It allows to keep messenger concept outside our messages while continuing to benefit from it.
Example
To group message by user for example
Current
After
Usage
It can be enabled with this kind of config