-
-
Notifications
You must be signed in to change notification settings - Fork 495
Moving the AMQP exchange from env var to config #608
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
Moving the AMQP exchange from env var to config #608
Conversation
This should make it easier to specify multiple transports using the same AMQP connection config, but with different exchanges.
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.
Pull request passes validation.
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.
Pull request passes validation.
@@ -5,7 +5,7 @@ framework: | |||
|
|||
transports: | |||
# https://symfony.com/doc/current/messenger.html#transports | |||
# async: '%env(MESSENGER_TRANSPORT_DSN)%' | |||
# async: '%env(MESSENGER_TRANSPORT_DSN)%/messages_exchange' |
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.
Maybe using ?exchange[name]=messages
is more self-explaining. Using the path for the virtual host and exchange is not self-explaining at all.
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 using the config options directly below the dsn. this would also make sure that options passed in the dsn would keep working. Something like
async:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
options:
exchange:
name: messages
This indeed makes it more obvious! 👍 I'm no Redis user but does this change apply to the "messages" suffix too? I also like the suggestions by @Tobion . I guess this should be added to docs in a different PR.
He states |
Sorry for the delay in replying! I realized, thanks to your suggestion, that my PR in fact does not work. The problem is that this So, I'm not sure what to do. the only way to make A) Do nothing. Close this PR, and update the AMQP documentation to help people. |
I would be in favor of option A. |
Normally every transport has his own parser for support this or i'm wrong ? |
You're right - every transport supports different options as query parameters (or under the I'm going to open a docs issue about this, and will hopefully document it soon. |
This should make it easier (more obvious how) to specify multiple transports using the same
AMQP connection config, but with different exchanges. Using a different exchange for each transport is the "main" way of supporting multiple transports (you can also use 1 exchange with multiple queues, but then it's up to you to change the exchange type to direct and manage binding and routing keys).
Docs issue: symfony/symfony-docs#11713
From Twitter convo: https://twitter.com/webdevilopers/status/1136177625406332928?s=21
Cheers!