-
1. Re: Scheduler service in Wildfly 9
wdfink Aug 31, 2015 5:04 PM (in response to sumanthreddybandi)Timer service would be my choice.
If you use a singleton the scheduled timer run only once as the Singleton will lock concurrent executions.
The HASingleton approach is only needed if you want to ensure to run the service once in your cluster.
Another approch with WildFly9 is to use the database persistence for the timers, in this case persistent timers are cluster aware and only executed once in the cluster.
-
2. Re: Scheduler service in Wildfly 9
sumanthreddybandi Sep 1, 2015 12:11 AM (in response to wdfink)My application has 2 clusters with 2 nodes in each cluster. Scheduler service needs to be run only once per cluster. How can we achieve HASingleton in WildFly 9?
I believe i cannot use he database persistence for the timers since both cluster connect to the same database. If i use this approach, scheduler service will run only on one cluster. Please correct me if i am wrong.
-
3. Re: Scheduler service in Wildfly 9
wdfink Sep 1, 2015 4:53 AM (in response to sumanthreddybandi)You can try the cluster-ha-singleton quickstart, this should start a timer on one node of each cluster.
The database-timers can be configured that each cluster use a different timer-storage (timer-partition) so you can separate both clusters, you might read this EJB3 Clustered Database Timers - WildFly 9