-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Messenger] Add doc for default routing for messages #16720
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
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 have not verified if this is a feature or not. But assuming you are correct; this feature definitely needs documentation.
I've been doing this in few of our projects and it works well. I think I heard about this on the Symfony slack and not in the documentation, so it's a nice addition. |
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.
Many thanks for that PR!
@@ -261,7 +261,13 @@ you can configure them to be sent to a transport: | |||
|
|||
Thanks to this, the ``App\Message\SmsNotification`` will be sent to the ``async`` | |||
transport and its handler(s) will *not* be called immediately. Any messages not | |||
matched under ``routing`` will still be handled immediately. | |||
matched under ``routing`` will still be handled immediately, i.e. synchronously. |
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.
matched under ``routing`` will still be handled immediately, i.e. synchronously. | |
matched under ``routing`` will still be handled immediately (e.g. synchronously). |
Before merging that PR, I'd like to add something. Using This caused issues on my project, because I am not sure how to convey that complex information on the Symfony doc though. Maybe someone with more experience on writing could improve that? |
Thanks Clement! I reworded your last comment as follows while merging: javiereguiluz@5781a94 |
Hello,
I recently got bit on production after deploying a code change. We created a new
FooMessage
&FooHandler
, but didn't update themessenger.yaml
to include routing information.This caused
FooMessage
to be directly handled by the HTTP process that dispatched the message, instead of the CLI, consumer process of Messenger. This lead to various issues: missing env var in HTTP context, lack of monitoring/stats as we only looks for messages metrics in theconsumer
container, not theapi
one :)Looking at the code, I discovered you may define a default transport, but couldn't find it in the doc.