-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[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
weaverryan
merged 11 commits into
symfony:4.1
from
sroze:revamp-the-messenger-documentation
May 9, 2018
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a4bc592
Rename the adapters to transport
sroze 3ff8cfe
Add multiple buses configuration and type-hint example
sroze ef70bc0
Add a documentation about the middlewares
sroze 10f46eb
Introduce the `TransportInterface`
sroze a20286d
Add a note about the symfony serializer pack
sroze 2409798
Middleware does not have a plural
sroze c76b2c2
Uses the full service name when configuring the buses from the YAML c…
sroze 9b7b85f
Update the example of using multiple buses to use DI's `bind`s
sroze e1f3b5a
Fix the formating of the method name
sroze 64bfd75
Change wording and don't use `.`-based services so it's just clearer
sroze c3c3528
Few updates following review
sroze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Middleware does not have a plural
- Loading branch information
commit 2409798251eb3b8bc2d38159aac0efd05f59766e
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
- App\\Middleware\\MyMiddleware | ||
|
||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
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 | ||
------------------ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Or if you just name your service after the FQCN manually. No need to mention this IMHO. It's still a service id. ^^
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.
I removed the use of the
.
-based service actually.