-
-
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
[Messenger] Update the messenger documentation #9727
Conversation
sroze
commented
May 3, 2018
•
edited
Loading
edited
- Fixes [Messenger] Added a middleware that validates messages #9641 with the middleware configuration.
- Fixes [Messenger][WCM] Document how to register multiple buses using the framework #9617 with the multiple bus configuration.
- Change adapters to transports (waiting merge: [Messenger] Rename Adapters to Transports symfony#27129)
- middlewares config entry is renamed middleware (Rename middlewares to middleware symfony#27177)
- in the config, message buses names are the full service id you'll use ([FrameworkBundle][Messenger] Remove convention-based service id generation for buses symfony#27162)
- Add TransportInterface as first class citizen sender+receiver ([Messenger] Add TransportInterface as first class citizen sender+receiver symfony#27164)
What about to add a note block before that about install/enable the Serializer component, to make AMQP transport available? |
Some more entries to add to the list :)
|
messenger.rst
Outdated
|
||
# Create buses | ||
buses: | ||
commands: ~ |
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.
Should be the full service name (and remove the note bellow)
messenger.rst
Outdated
|
||
use Symfony\Component\Messenger\AbstractMessageBusDecorator; | ||
|
||
final class CommandBus extends AbstractMessageBusDecorator |
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.
Recommend binding the message bus variable name instead
@ogizanagi could you send a PR for that? Has it's not been merged yet, I'd prefer to move it out of the scope of this PR. |
Sure I'll do once this one is merged. |
@javiereguiluz @weaverryan could you have a look at this one? 🙏 |
messenger.rst
Outdated
buses: | ||
messenger.bus.default: | ||
middleware: | ||
# Works with the FQCN if the class discovery is enabled |
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.
messenger.rst
Outdated
# Or with some service name | ||
- app.middleware.yours | ||
|
||
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 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)
41bebe5
to
3ffc785
Compare
messenger.rst
Outdated
@@ -107,11 +107,20 @@ configure the following services for you: | |||
1. A ``messenger.sender.amqp`` sender to be used when routing messages. | |||
2. A ``messenger.receiver.amqp`` receiver to be used when consuming messages. | |||
|
|||
.. note:: | |||
|
|||
In order to use Symfony's built-in AMQP adapter, you will need the Serializer |
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.
AMQP transport
?
messenger.rst
Outdated
messenger.bus.default: | ||
middleware: | ||
- "App\\Middleware\\MyMiddleware" | ||
- "App\\Middleware\\AnotherMiddleware" |
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.
single quote and single backslash to be concistent?
bfa508b
to
c3c3528
Compare
Thank you @sroze! |
This PR was submitted for the master branch but it was squashed and merged into the 4.1 branch instead (closes #9727). Discussion ---------- [Messenger] Update the messenger documentation - [x] Fixes #9641 with the middleware configuration. - [x] Fixes #9617 with the multiple bus configuration. - [x] Change adapters to transports (waiting merge: symfony/symfony#27129) - [x] middlewares config entry is renamed middleware (symfony/symfony#27177) - [x] in the config, message buses names are the full service id you'll use (symfony/symfony#27162) - [x] Add TransportInterface as first class citizen sender+receiver (symfony/symfony#27164) Commits ------- c3c3528 Few updates following review 64bfd75 Change wording and don't use `.`-based services so it's just clearer e1f3b5a Fix the formating of the method name 9b7b85f Update the example of using multiple buses to use DI's `bind`s c76b2c2 Uses the full service name when configuring the buses from the YAML configuration 2409798 Middleware does not have a plural a20286d Add a note about the symfony serializer pack 10f46eb Introduce the `TransportInterface` ef70bc0 Add a documentation about the middlewares 3ff8cfe Add multiple buses configuration and type-hint example a4bc592 Rename the adapters to transport