amqp
amqp copied to clipboard
channel.Consume with a empty queue name
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
?
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?