-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Messenger][WIP] Show how to configure multiple buses #10016
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
I don't know if this is a hard rule for Symfony docs, but the framework integration usually is documented in the Guides section or a dedicated page, not in the Component documentation itself. |
Please describe how to register command/event/query handlers and how to seggregate them between buses. Nobody wants handle received message from from event bus through middlewares for command bus. |
- messenger.middleware.validation | ||
messenger.bus.event: | ||
middleware: | ||
- messenger.middleware.allow_no_handler |
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.
In 4.2, default_middleware: allow_no_handlers
must be used instead.
(https://github.com/symfony/symfony/blob/master/UPGRADE-4.2.md#frameworkbundle)
You can configure these buses and their rules by using middlewares. | ||
|
||
It might also be a good idea to separate actions from reactions by introducing | ||
an **event bus**. The event bus could have zero or more subscribers. |
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.
If we're mentioning that events have zero or more subscribers, we should probably mention that commands and queries have exactly one handler.
Thank you @magnusnordlander and @ogizanagi |
In https://symfony.com/doc/master/messenger/multiple_buses.html there is no example for a routing configuration for multiple buses. It would be nice if there was a typical example configuration, something like: |
We do currently have no example configuration with the framework bundle. I think it is a good idea to show of how to use middleware's and how to define multiple buses.
This PR could be rewritten as a part of an existing page.
I know the configuration is not very different between the buses. When symfony/symfony#27839 and symfony/symfony#27840 is implemented, this config will make more sense.