Reputation: 16992
I have an spring boot application deployed in pivotal cloud foundry. I have 4 instances of the application running. The applications consume message from queue in RabbitMQ and do further processing. If I set the number of consumers for the queue to 40 in RabbitMQ , will the 40 consumers be equally distributed among the apps that are listening?
Upvotes: 2
Views: 391
Reputation: 5659
From the documentation here:
By default, RabbitMQ will send each message to the next consumer, in sequence. On average every consumer will get the same number of messages. This way of distributing messages is called round-robin
To answer your question, the load will be approximately equal between your applications.
Another somewhat supporting snippet from here:
Direct exchanges are often used to distribute tasks between multiple workers (instances of the same application) in a round robin manner. When doing so, it is important to understand that, in AMQP 0-9-1, messages are load balanced between consumers and not between queues.
Upvotes: 4