-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] InMemoryTransport handle acknowledged and rejected messages #32783
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
[Messenger] InMemoryTransport handle acknowledged and rejected messages #32783
Conversation
Hey @tienvx nice to meet you. I've seen just seen your mbtBundle, Then I saw this https://github.com/tienvx/messenger-memory-transport repo on your github page and I remembered to have seen a PR about memory transport on symfony. And indeed it's you. Funny chain of exploration that let me came back here in the end. I always end here in symfony. I think I'm cursed ;) |
Hello @Tobion nice to meet you too. I think because it's a small world :D btw, when this MR is merged, my repo https://github.com/tienvx/messenger-memory-transport can be archived |
Fixed a code conflict, but test case failed after merging with branch 4.4. The test case failed is in |
All green here, any update on this? |
All green. There are no more updates. This PR is waiting to be reviewed again |
src/Symfony/Component/Messenger/Transport/InMemoryTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Transport/InMemoryTransport.php
Outdated
Show resolved
Hide resolved
Thanks for your review @Tobion . I updated the code. Please review again. Currently CI failed because of the Console component. |
src/Symfony/Component/Messenger/Transport/InMemoryTransport.php
Outdated
Show resolved
Hide resolved
Thank you @tienvx. |
…rejected messages (tienvx) This PR was merged into the 4.4 branch. Discussion ---------- [Messenger] InMemoryTransport handle acknowledged and rejected messages | Q | A | ------------- | --- | Branch? | 4.4 <!-- see below --> | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs/pull/12045 <!-- required for new features --> This PR do 2 things: * Limit receiving messages from InMemoryTransport to 1 (reverted, another PR will fix the bug: worker does not stop when receiver return more messages than the number specify by the `--limit` option) * Handle acknowledged and rejected messages in InMemoryTransport. Currently, it does not care about acknowledged and rejected messages. So it always return all messages that have been sent. So if we run console command `messenger:consume`, it will never stop, even though we set the `--limit` option. For more information, please check the [reproduction](https://github.com/tienvx/symfony-messenger-in-memory-reproduction) project for the expected behavior. See also my [messenger-memory-transport](https://github.com/tienvx/messenger-memory-transport) project Commits ------- 71e7bdf [Messenger] InMemoryTransport handle acknowledged and rejected messages
This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] Stop worker when it should stop | Q | A | ------------- | --- | Branch? | 4.3 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | NA <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | NA <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch. --> There are 2 things about this PR: * This PR fix the bug when using `limit`, `memory-limit`, `time-limit` options with command `messenger:consume`, these options does not work if the receiver return multiple messages * This PR is the continue work of #32783 Commits ------- 5c1f3a2 [Messenger] Stop worker when it should stop
This PR do 2 things:
--limit
option)messenger:consume
, it will never stop, even though we set the--limit
option.For more information, please check the reproduction project for the expected behavior.
See also my messenger-memory-transport project