java - How to avoid running duplicate tasks in a High Avaliability Clustered JBoss EAP -
im developing application needs have background jobs, example sending emails on pending alerts. in standalone configuration jobs configured , working fine spring scheduler , scheduled-tasks. don't know how make them work synchonized on clustered high avaliability jboss environment. main problem avoid jobs on different nodes run @ same time.
i've read quartz:
http://quartz-scheduler.org/documentation/quartz-2.x/configuration/configjdbcjobstoreclustering
but it's not recomended on on high avaliability scenario:
never run clustering on separate machines, unless clocks synchronized using form of time-sync service (daemon) runs regularly (the clocks must within second of each other). see http://www.boulder.nist.gov/timefreq/service/its.htm if unfamiliar how this.
by have workarounded synchronization problem self made blocking system (why pessimistic locking in jpa oracle not working). wish know if jboss provides solution common problem.
you can try ha singleton, ejb singleton configured running on 1 node in cluster. singleton can use ejb timer service scheduling jobs. see documentation ha singleton: https://access.redhat.com/documentation/en-us/jboss_enterprise_application_platform/6/html/development_guide/implement_an_ha_singleton.html
Comments
Post a Comment