Skip to content

[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

Merged
merged 1 commit into from
Aug 18, 2019
Merged

[Messenger] InMemoryTransport handle acknowledged and rejected messages #32783

merged 1 commit into from
Aug 18, 2019

Conversation

tienvx
Copy link
Contributor

@tienvx tienvx commented Jul 27, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #...
License MIT
Doc PR symfony/symfony-docs/pull/12045

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 project for the expected behavior.

See also my messenger-memory-transport project

@Tobion
Copy link
Contributor

Tobion commented Aug 2, 2019

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 ;)

@tienvx
Copy link
Contributor Author

tienvx commented Aug 2, 2019

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

@tienvx
Copy link
Contributor Author

tienvx commented Aug 2, 2019

Fixed a code conflict, but test case failed after merging with branch 4.4. The test case failed is in src\Symfony/Bundle/FrameworkBundle

@OskarStark
Copy link
Contributor

All green here, any update on this?

@tienvx
Copy link
Contributor Author

tienvx commented Aug 14, 2019

All green. There are no more updates. This PR is waiting to be reviewed again

@tienvx
Copy link
Contributor Author

tienvx commented Aug 17, 2019

Thanks for your review @Tobion . I updated the code. Please review again. Currently CI failed because of the Console component.

@fabpot
Copy link
Member

fabpot commented Aug 18, 2019

Thank you @tienvx.

fabpot added a commit that referenced this pull request Aug 18, 2019
…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
@fabpot fabpot merged commit 71e7bdf into symfony:4.4 Aug 18, 2019
@tienvx tienvx deleted the handle-acknowledged-rejected-messages branch August 18, 2019 09:03
fabpot added a commit that referenced this pull request Aug 26, 2019
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
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants