You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing a software architecture using RabbitMQ as the message broker and want to use a Topic Exchange. Some services require multiple routing keys to be bound to the same queue.
We created three bindings: Q1 is bound with binding key ".orange." and Q2 with "..rabbit" and "lazy.#".
These bindings can be summarised as:
Q1 is interested in all the orange animals.
Q2 wants to hear everything about rabbits, and everything about lazy animals.
I have already attempted to replicate this in the code example below. But whenever the order service publishes to the inventory queue with the routing key 'shop.order.created', it is received by the first RabbitSubscribe decorator configured..
The documentation talks about Competing Consumers for when you have two decorators using the same named queue. But why does this apply if the routingKey is different, this means that the exchange and queue aren't adhearing to the routing key.
In RabbitMq management, it shows that the inventory queue has two different routing keys bound. Is there a work around other than NOT using a named queue for the other routing key as this would create a new queue which I don't want and doesn't follow the desired pattern.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am developing a software architecture using RabbitMQ as the message broker and want to use a Topic Exchange. Some services require multiple routing keys to be bound to the same queue.
Reference: https://www.rabbitmq.com/tutorials/tutorial-five-javascript.html
I have already attempted to replicate this in the code example below. But whenever the order service publishes to the inventory queue with the routing key 'shop.order.created', it is received by the first RabbitSubscribe decorator configured..
The documentation talks about Competing Consumers for when you have two decorators using the same named queue. But why does this apply if the routingKey is different, this means that the exchange and queue aren't adhearing to the routing key.
In RabbitMq management, it shows that the inventory queue has two different routing keys bound. Is there a work around other than NOT using a named queue for the other routing key as this would create a new queue which I don't want and doesn't follow the desired pattern.
Beta Was this translation helpful? Give feedback.
All reactions