Working with RabbitMQ EventingBasicConsumer c# with multiple instances #1520
-
Hi, We are using EventingBasicConsumer in RabbitMQ c# and same queue has initialized with EventingBasicConsumer with different instances. Here is the example: Instance A, creates a new session of RabbitMQ and initialize the event consumer for a queue name (lets say, queuename: ABC) Instance B, creates a new session of RabbitMQ and initialize the event consumer for a same queue name (ABC) Instance A and Instance B are from same client (Host/Procedure), which sends messages from both instances Now a message sent from Instance A to queue ABC, now does eventingbasicconsumer which initializes B will consume the message sent from Instance A? Is that how it works? Please let me know, we are facing currently and wants to know the how does EventingBasicConsumer consumer works when two instance created for same queue from same host/client/producer. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There is no guarantee that "Instance B" will get the message published by "Instance A". There is an equal chance that the "Instance A" and "B" consumers will get the message. This is RabbitMQ's behavior and isn't specific to this library. |
Beta Was this translation helpful? Give feedback.
-
@Pramod34 see tutorial 2. Competing consumers (consumers on the same queue) have messages distributed in a round robin manner. Channel prefetch can affect this somewhat but the general idea remains the same. |
Beta Was this translation helpful? Give feedback.
@Pramod34 see tutorial 2. Competing consumers (consumers on the same queue) have messages distributed in a round robin manner. Channel prefetch can affect this somewhat but the general idea remains the same.