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
Hi, I'm trying to consume from 2 sharded queues that are bound to my exchange. I can successfully read off one queue with the following code but never the other. Is it possible to read off both queues with one consumer? Even if it isn't, when queue 0 is empty and queue 1 has 2000 entries it still only reads from 0.
var factory = new ConnectionFactory() { HostName = "localhost", Port = 5672 };
using (var connection = factory.CreateConnection())
{
using (var channel = connection.CreateModel())
{
var consumer = new EventingBasicConsumer(channel);
consumer.Received += (model, ea) =>
{
var body = ea.Body.ToArray();
var message = Encoding.UTF8.GetString(body);
Console.WriteLine(" [x] Received {0}", message);
};
channel.BasicConsume(queue: "TestExchange",
autoAck: true,
consumer: consumer);
}
}
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
-
Hi, I'm trying to consume from 2 sharded queues that are bound to my exchange. I can successfully read off one queue with the following code but never the other. Is it possible to read off both queues with one consumer? Even if it isn't, when queue 0 is empty and queue 1 has 2000 entries it still only reads from 0.
Beta Was this translation helpful? Give feedback.
All reactions