0 Replies Latest reply on Jul 14, 2016 4:57 AM by Peter Butkovic

    EJB3 clustered timer, once server stopped, no other server (in domain/group) takes over

    Peter Butkovic Newbie

      I'm using Wildfly 9.0.2 and jdk 1.8.


      I followed: http://www.mastertheboss.com/jboss-server/wildfly-8/creating-clustered-ejb-3-timers

      and created the clustered timer, which runs every 5 seconds.


      I have running domain of:

      - 1 master

      - 2 slaves, each have 2 servers configured (all in the same group)




      public class FooEJB {


          @Schedule(hour = "*", minute = "*", second = "*/5", info ="foo timer",persistent=true)

          public void printDate() {   

              System.out.println("It is " + new java.util.Date().toString());




      I've configured my domain.xml respectively:


      <datasource jta="true" jndi-name="java:/jdbc/fooDS" pool-name="pgre" enabled="true" use-ccm="true">





























      <timer-service thread-pool-name="default" default-data-store="clustered-store">


                              <database-data-store name="clustered-store" datasource-jndi-name="java:/jdbc/fooDS" database="postgresql" partition="timer" refresh-interval="10000"/>






      All works nicely => Only 1 timer is executed (every 5 secs), as I see in the log file, as well as in the DB the table jboss_ejb_timer.


      However, once I stop the server that has the DB lock (=> runs the timer), no other server takes over unless there is a new server started.

      Is there a way for all those, that didn't retrieve the lock originally, to retry with some interval?