I was confused #9834
-
Describe the bugI just want to receive message which routing_key is .test.,but I received all. Maybe It don`t use like this? Reproduction stepsExpected behavioraa.test.aa test1 Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't think I understand what the goal is, as You bind the same queue twice with two routing patterns. Regardless of which one of them matches, the same queue will end up containing both "kinds" of messages. Usually if you want to separate messages you must also use different queues, otherwise why use different routing patterns at all. |
Beta Was this translation helpful? Give feedback.
I don't think I understand what the goal is, as
.test.
is a weird routing key since it starts with a segment separator. The segments are then["", "test", ""]
.*
matches a single segment in AMQP 0-9-1, including when it is empty (or at least the spec does not special case an empty segment, and neither does the RabbitMQ topic exchange routing implementation IIRC).You bind the same queue twice with two routing patterns. Regardless of which one of them matches, the same queue will end up containing both "kinds" of messages. Usually if you want to separate messages you must also use different queues, otherwise why use different routing patterns at all.