Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Messenger] AMQP configurable routing key & multiple queues#30770
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Messenger] AMQP configurable routing key & multiple queues#30770
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ents' into amqp-multiple-queues-routing-keys* G15N/ticket-29950-bus-dispatch-enhancements: [messenger] Adds a stamp to provide a routing key on message publishing.
ad8f4d8 to3444173Compare| $this->queue()->bind($this->exchange()->getName(),$this->queueConfiguration['routing_key'] ??null); | ||
| foreach ($this->queuesConfigurationas$queueName =>$queueConfig) { | ||
| $this->queue($queueName)->declareQueue(); | ||
| foreach ($queueConfig['routing_keys'] ?? []as$routingKey) { |
bentcoderMar 29, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
@weaverryan Just to confirm, as far as I understand, this line addresses the first point (AMQP configuration) I madehere. Am I correct?
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’m not sure exactly which was your first point. But this part allows you to declare that you want messenger to create multiple queues on your behalfand create multiple binds for each queue. I’m pretty sure this was at least one of your issues :). This part is all about creating and binding of queues - these specific lines say nothing about the publishing process or what routing keys are used.
| $this->queue()->bind($this->exchange()->getName(),$this->queueConfiguration['routing_key'] ??null); | ||
| foreach ($this->queuesConfigurationas$queueName =>$queueConfig) { | ||
| $this->queue($queueName)->declareQueue(); | ||
| foreach ($queueConfig['routing_keys'] ?? []as$routingKey) { |
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.
@weaverryan , don't forget to renamerouting_keys tobinding_keys for this binding part (also in constructor doc)
bentcoder commentedMar 30, 2019
@weaverryan My comment above referes to section below: |
weaverryan commentedMar 30, 2019
@bentcoder yep, then that code is indeed doing what you want. It allows you to bind multiple routing keys to the queue, though we may rename them to binding_keys, I think that’s more accurate. |
Hi!
This builds on top of#30008. In fact, I would beperfectly happy if@G15N pulled in my commit into his branch and finished it on his PR (we would close this one then). I just wanted to make sure the 2nd half got done.
This adds 2 things:
AmqpRoutingKeyStampthat allows you to configure the routing keyIt also fixes a few things I'm pretty sure were wrong - specifically the
attributesandflagsconfiguration for a queue were also sent when publishing a message. I don't think that makes sense: when you're publishing a message, you have no idea what queue you will go to. These 2 options are now NOT configurable for each message, which makes me wonder if we should add 2 new stamps for these, or merge onto one biggerAmqpConfigurationStampclass.Cheers!