Consume from multiple queues at once.
Hello,
my use-case is to consume from multiple queues at once using a single AmqpClient::Channel.
To consume messages from multiple queues I create a channel and call the Channel::BasicConsume() method (source).
auto channel = AmqpClient::Channel::CreateFromUri("...");
std::string consumer_tag1 = channel->BasicConsume("queue1", "");
std::string consumer_tag2 = channel->BasicConsume("queue2", "");
Now I want to use the method named Channel::BasicConsumeMessage() to consume multiple consumer tags (source).
AmqpClient::Envelope::ptr_t envelope = channel->BasicConsumeMessage({consumer_tag2, consumer_tag1});
This seems to be a correct usage since there is no other way how can I obtain consumer tags other than multiple calls to Channel::BasicConsume().
What I am worried about is the note in the documentation to Channel::BasicConsume() (source):
Note: due to a limitation to how things are done, it is only possible to reliably
have a single consumer per channel, calling this more than once per channel
may result in undefined results from BasicConsumeMessage.
My question is: Is the note still actual or it is just a leftover from some previous revision? Does it still cause trouble? If so, why there is a possibility to pass a vector of consumer tags into the Channel::BasicConsumeMessage() method?
I'm having the same problem. Did you figure out if this is the correct way to consume from multiple queues?
Frankly, I don't remember the outcome. It has been almost 2 years since the issue was posted. We switched to a single queue model just for simplicity.