streadway / amqp

Go client for AMQP 0.9.1
http://godoc.org/github.com/streadway/amqp
BSD 2-Clause "Simplified" License
4.88k stars 621 forks source link

channel.Consume with a empty queue name #480

Open cuizhipeng326 opened 4 years ago

cuizhipeng326 commented 4 years ago

I created two queues with two different queue names and keys in the same channel. I use the Consume function like this: delivery, err := consumer.channel.Consume("", "", true, false, false, false, nil) The consumer created two queues(one key is "test" and another key is "#" which is means matching everything), and bound with the same topic type exchange. When using another channel to publish some messages with the key of test, I only can get one copy of origin messages. I think I can get two copies of origin messages from two queues, because I didn't specify the queue name in Consume function. But I only got one copy of origin messages from delivery. I am confused with this case, which queue actually is being consuming in delivery?

cuizhipeng326 commented 4 years ago

After doing some test with RabbitMQ, I came to the conclusion that ·Consume· by a empty queueName will get the access to the last queue bound through the channel. I think ·Consume· should return an error with no specify queueName. Is this a issue left over?