-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Suggest to provide a DropMessageMiddleware #26901
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
Comments
Hi @romain-pierre |
👋 @romain-pierre. Did you see this question? |
Both way seem valid to me, depending of the situation. The service decorator is probably the best way if we don't want to care about the middleware priority. Anyway it's always a simple option to write its own middleware to drop messages for edge cases. |
Let's close it for now then :) |
I've opened #27320 btw |
This PR was merged into the 4.2-dev branch. Discussion ---------- [Messenger] Activation middleware decorator | Q | A | ------------- | --- | Branch? | master <!-- see below --> | Bug fix? | no | New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | part of #26901 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | TODO A small middleware decorator that can be wired using DI decoration to enable/disable a middleware on an arbitrary condition. This can be used to keep the same middleware stack across env but enable/disable some of them through this. Commits ------- 6e43838 [Messenger] Activation middleware decorator
Hi, in my project, I need to disable message dispatching for some edge-cases. For exemple, when loading data-fixtures, I need to disable mail delivery (welcome mails are sent on Doctrine persist event). For that, I use a processor with AliceFixture, and this processor enable or disable a middleware in charge of dropping the messages. Do you think that this middleware could be useful for someone else and should be embedded with the component?
The text was updated successfully, but these errors were encountered: