3 Replies Latest reply on Sep 1, 2015 4:53 AM by Wolf-Dieter Fink

    Scheduler service in Wildfly 9

    Sumanth Bandi Newbie



      My application is running on JBoss 4.2.3 in a clustered environment. There is a scheduler service which pulls data from the database in every 10 sec. We achieved this by placing **-service.xml in deployments folder and by implementing "org.jboss.system.ServiceMBean" interface in JBoss 4.2.3.


      Now, i am upgrading jboss to Wildfly 9. As we cannot achieve scheduler service in wildfly with the existing mechanism(wildfly doesn't support org.jboss.varia.scheduler.SingleScheduleProvider), i am looking at alternatives EJB TimerService & ManagedScheduledExecutorService. Our requirement is to run the scheduled service only in one node of the cluster which we achieved using HASingletonDeployer.


      My qns:

      1. Which is better - EJB TimerService or ManagedScheduledExecutorService? My Scheduler task should invoke only if the previous task is finished i.e. i don't need concurrent tasks.

      2. How can we achieve that the scheduled task/method is run only on one node in a cluster?


      Please suggest. Thanks in advance.