Skip to content

One client reads all messages from all queues? #1146

@ZedZipDev

Description

@ZedZipDev

I use queues bound to 'direct' exchange. It was my goal:

I have N clients, each of them connects to RabbitMQ, creates its own queue, bind it to 'direct' exchange,
An app-publisher sends 1 message and it broadcasting to all these queues. i.e. N queues has N messages: queue has 1
Every customer reads its own queue and consumes messages from the queue only.

I run c# apps and check the RabbitMQ:
I run loop and send K messages for each of N queues
Check the R : ok each of N queue has K messages

Run the reader :

  var connection = connectionFactory.CreateConnection();
            var channel = connection.CreateModel();
            channel.BasicQos(0, 1, false);
            var msgReceiverd = new MessageReceiverd(channel, RMQList2);
            channel.BasicConsume(RMQQueueName.Value, false, msgReceiverd);

Output is all K*N messages (instead of K)
Check the Web page and see all queues are idle and no messages

Why one client reads all messages from all queues bound to the same direct exchange?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions