Exclusive consumers are available in Apache ActiveMQ and may also be used over the STOMP transport. Exclusive consumers a new feature in ActiveMQ 4.x. The broker will pick a single MessageConsumer to get all the messages for a queue to ensure ordering. If that consumer fails, the broker will auto failover and choose another consumer.
With the Habari Client library for ActiveMQ, the exclusive consumer is created as follows:
QueueExclusive := Session.CreateQueue('TEST.QUEUE?activemq.exclusive=true');
- Guaranteed ordering of the processing of related messages across a single queue.
- Load balancing of the processing of messages across multiple consumers.
- High availability / auto-failover to other consumers if a JVM goes down.
Apache ActiveMQ Artemis
DUnit / FPCUnit tests
In the Habari Client libraries for ActiveMQ and Artemis 2019.06, the test suite has been extended to include exclusive consumer and message group tests.
About Habari Client libraries
Habari Client libraries enable Object Pascal applications to take advantage of message broker / message queue technology – which is distributed, loosely coupled, reliable and asynchronous – to build integrated systems, using peer-to-peer and publish-subscribe communication models. Habari Client libraries are available for the free open source message brokers Apache ActiveMQ, Artemis, Open MQ and RabbitMQ.