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.

http://docs.oracle.com/cd/E24329_01/web.1211/e24425/service_migration.htm#CLUST373
https://docs.oracle.com/middleware/1212/wls/WLACH/taskhelp/clusters/ConfigureSingletonService.html
http://docs.oracle.com/cd/E24329_01/apirefs.1211/e24391/weblogic/cluster/singleton/SingletonService.html
http://developsimpler.blogspot.ch/2012/03/weblogic-clusters-and-singleton-service.html
http://developsimpler.blogspot.ch/2012/03/weblogic-clusters-and-singleton-service.html
http://docs.oracle.com/html/E24401_02/taskhelp/clusters/ConfigureSingletonService.html

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


  <singleton-service>
    <name>Singleton Service-0</name>
    <class-name>com.pippo.pluto.MySingletonService</class-name>
    <cluster>Cluster-0</cluster>
  </singleton-service>






No comments: