8000 [Messenger] Update the messenger documentation by sroze · Pull Request #9727 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] Update the messenger documentation #9727

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 11 commits into from
May 9, 2018
Prev Previous commit
Next Next commit
Middleware does not have a plural
  • Loading branch information
sroze authored and weaverryan committed May 9, 2018
commit 2409798251eb3b8bc2d38159aac0efd05f59766e
28 changes: 14 additions & 14 deletions messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,28 +228,28 @@ your ``CommandBus`` in your services:
services:
App\CommandBus: ['@messenger.bus.commands']

Middlewares
-----------
Middleware
----------

What happens when you dispatch a message to a message bus(es) depends on its
middlewares (and their order). By default, the middlewares configured for each
bus looks like this.
collection of middleware (and their order). By default, the middleware configured
for each bus looks like this:

1. ``logging`` middleware. Responsible of logging the beginning and the end of the
message within the bus.

2. _Your own middlewares__
2. _Your own collection of middleware__

3. ``route_messages`` middleware. Will route the messages your configured to their
corresponding sender and stop the middleware chain.

4. ``call_message_handler`` middleware. Will call the message handler(s) for the
given message.

Adding your own middlewares
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adding your own middleware
~~~~~~~~~~~~~~~~~~~~~~~~~~

As described in the component documentation, you can add your own middlewares
As described in the component documentation, you can add your own middleware
within the buses to add some extra capabilities like this:

.. code-block:: yaml
Expand All @@ -258,7 +258,7 @@ within the buses to add some extra capabilities like this:
messenger:
buses:
default:
middlewares:
middleware:
# Works with the FQCN if the class discovery is enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if you just name your service after the FQCN manually. No need to mention this IMHO. It's still a service id. ^^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the use of the .-based service actually.

- App\\Middleware\\MyMiddleware

Expand All @@ -267,19 +267,19 @@ within the buses to add some extra capabilities like this:

Note that if the service is abstract, then a child service will be created per bus.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then a different instance of service will be created per bus.? (more concrete for the user I think)


Disabling default middlewares
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Disabling default middleware
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you don't want the default middlewares to be present on your bus, you can disable
them like this:
If you don't want the default collection of middleware to be present on your bus,
you can disable them like this:

.. code-block:: yaml

framework:
messenger:
buses:
default:
default_middlewares: false
default_middleware: false

Your own Transport
------------------
Expand Down
0