This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bundle/FrameworkBundle/Tests
Samuel ROZE da4fccd37c feature #26864 [Messenger] Define multiple buses from the framework.messenger.buses configuration (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #26864).

Discussion
----------

[Messenger] Define multiple buses from the `framework.messenger.buses` configuration

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26652
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/issues/9617

Not everybody will benefit from having only one bus, especially with the CQRS-like usages. While keeping the extremely use of use of the single bus, this PR has the following:

- Create multiple buses from the YAML configuration
- Tag middleware only a specific buses
- Register middlewares from the YAML configuration

Even if it's visible in the PR's tests, here's how it will look like, for a completely full-customised version:
```yaml
framework:
    messenger:
        default_bus: commands
        buses:
            commands: ~
            events:
                middlewares:
                    - validation
                    - route_messages
                    - "Your\\Middleware\\Service"
                    - call_message_handler
```

A few things to note:
1. The YAML configuration creates `messenger.bus.[name]` services for the buses.
2. The YAML configuration for middleware just adds tags to the corresponding middlewares.
3. If the middleware definition does not exists, it creates it. (without any magic on the arguments though, if it isn't auto-wirable, well... "your problem")
4. In the PR, there is this "TolerateNoHandler" middleware that is a great example for event buses

Commits
-------

e5deb8499b [Messenger] Define multiple buses from the `framework.messenger.buses` configuration
2018-04-25 18:39:19 +02:00
..
CacheWarmer Merge branch '4.0' 2018-03-19 23:38:22 +01:00
Command Improved the lint:xliff command 2018-03-30 10:39:04 +02:00
Console [DI][FrameworkBundle] Hide service ids that start with a dot 2018-04-20 15:14:43 +02:00
Controller feature #26281 [FrameworkBundle] keep query in redirect (Simperfit) 2018-03-27 09:45:03 +02:00
DependencyInjection feature #26864 [Messenger] Define multiple buses from the framework.messenger.buses configuration (sroze) 2018-04-25 18:39:19 +02:00
EventListener check _controller attribute is a string before parsing it 2017-07-10 18:12:17 +02:00
Fixtures [DI][FrameworkBundle] Hide service ids that start with a dot 2018-04-20 15:14:43 +02:00
Functional [FrameworkBundle] Register all private services on the test service container 2018-04-25 16:27:01 +01:00
Kernel Deprecate bundle:controller:action and service:method notation 2018-02-21 06:14:04 +01:00
Routing fix test 2018-03-01 11:49:02 +01:00
Templating Merge branch '4.0' 2018-04-02 12:08:33 +02:00
Translation Merge branch '3.3' into 3.4 2017-12-31 07:07:31 +01:00
ClientTest.php [FrameworkBundle] Allow to disable Kernel reboot 2015-03-20 11:50:15 +01:00
TestCase.php Update to PHPUnit namespaces 2017-02-18 08:02:39 -08:00