...
- The load is distributed in a very dynamic fashion. Additional consumers could be provisioned and attached to the queue in high load periods, without modifying any configuration in the queue, as the new consumer would behave as just another competing consumer.
- Better availability than systems using a load balancer. Load balancers usually rely on a monitorization system to find out which real-servers are unavailable. With competing consumers, a failed consumer won't be competing for messages and therefore messages won't be delivered to it even without monitorization.
- High reliability, if a consumer diesfails, any unacknowledged messages are redelivered to other consumers on the queue.
On the downside, this pattern might not be ideal in systems where the ordered order processing is required. To mitigate this problem while maintaining the benefits, the competing consumers pattern should be used in conjunction with other ActiveMQ features like the exclusive consumers and the message groups as stated in the ActiveMQ's FAQ.
...