3 Replies Latest reply on Nov 2, 2014 12:16 PM by Wolf-Dieter Fink

    EJB3.1 Timer Service issue in Jboss Cluster Environment.---Urgent!!!

    Alex Xu Newbie

      Hi,

         Our company has a web based project which using the Jboss EAP 6.1 +EJB 3.1 + JSF2 and deployed it in a cluster environment(Server A,Server B and Server C).

         We have created some schedule tasks by using EJB timer service and the timer data file is stored in a central file system.

         And users can login and access to a task configuration page to customise his own tasks by create,update,delete actions etc.

         But we find that the timers don't work correctly in the cluster environment.

         For example.

          When we start the Servers(A,B,C),each server will load the timer file data into his own node cache from the central file system.

        But when one user go to the task configuration page to update or delete his own tasks from one of the Servers, it only update the change on its own node cache and

        don't replicate the timer data to other nodes' cache and which cause the problem.

        

        I know there is one way to fix it is that we could shutdown the three Servers and re-boot them and the timer data file will be re-loaded into each server's cache. But we can't do that because the users want their own created/updated tasks take effect immediately once they change them.

        

        My question is that when the timer data in cache is updated on one server, how to make it synchronise to the other Servers'.

        

        I am not a native English speaker and hope I have expressed my question clearly.

        

        It is quite urgent and any tips or solution are highly appreciated!

        

        

        Thanks,

        

        Alex

        • 1. Re: EJB3.1 Timer Service issue in Jboss Cluster Environment.---Urgent!!!
          Wolf-Dieter Fink Master

          Hello Alex,

          From the JEE specification there is nothing exact defined how a timer should work in a cluster.

          This behaviour has not changed since the first JBoss versions there are different strategies to persist timers, but there was never a possibility to synchronize it across several nodes.

           

          That has changed in WildFly9, as there is a DB persistence and it is cluster aware, not optimal at the moment as I wish not all timers are loaded into the memory.

          As WildFly9+ will be the base for EAP7 this feature will be available then.

           

          As EAP6, AS7 and WildFly8 use the local filesystem to store timers it will not help to restart the servers as each server will only load it's own timers.

          • 2. Re: EJB3.1 Timer Service issue in Jboss Cluster Environment.---Urgent!!!
            Alex Xu Newbie

            Hello Wolf-Dieter:

               Thanks for your answer. It is quite a helpful information to me. But we can't wait for EAP7 available even it can solve this problem.

               Maybe we will use Quartz instead of EJB3.1 Timer Service to make our schedule tasks work in the Cluster environment.

              

               You mentioned that "As EAP6, AS7 and WildFly8 use the local filesystem to store timers it will not help to restart the servers as each server will only load it's own timers.".

               Actually we use a shared filesystem to store timers instead of the local one on each Server. So when we shutdown the servers, timers' data in each node's cache will be written back to this shared timer filesystem. So when we re-start the servers,each server will load the timers from the shared timer data file instead of the local one into each server's cache and then all timers on each server are consistence.

             

            Regards,

            Alex

            • 3. Re: EJB3.1 Timer Service issue in Jboss Cluster Environment.---Urgent!!!
              Wolf-Dieter Fink Master

              Shared filesystem might have impacts, i.e. overwrite timers or create it duplicate.

              Also you should not share other directories from data as this will not work correctly!