Friday, January 15, 2016

Singleton service in cluster to consume JMS messages with disaster recovery

"We consume messages from a (MQ) queue
We have two servers. One is the primary and consumes the messages. The secondary does not normally consume messages.
If the primary server falls over (DR), then the secondary should start consuming the messages.
How to implement this?

register a custom Singleton service (message listener) on a cluster, as JMS listener of the Queue, with automated migration: assign it by default to a specific instance: if this instance fails, the singleton is reassigned to another instance. Automated migration is ensured by the DB leasing mechanism.

This should appear in your config.xml, after startup-class and before admin-server-name:

    <name>Singleton Service-0</name>

No comments: