4 Replies Latest reply on Jan 23, 2006 4:38 PM by Barry Raczkowski

    Timer vs. cluster & scheduler

    fredatwork Newbie

      Hello,

      I have a few questions about EJB timers :

      1/ I'm interested to know what JBoss 4.0 AS does with timers in a clustered environment. More specifically, I would like to know if timers can be made highly available with JBoss clustering features (the J2EE specification does not mandate high availability or clustering for timers) ? What happens if a node containing the timer goes down ? Does another node will automatically create a new EJB timer ? Is there a way to do this ?

      2/ I read in an older post (back in 2003) that Scott Stark (my favorite CTO ... ) seemed, at the time, be willing to use Quartz as JBoss scheduler and that this would effect EJB Timer Service as well. ? What is the status on this issue ?

      Can anyone explain where JBoss is heading in terms of scheduling service ?


      Fred

        • 1. Re: Timer vs. cluster & scheduler
          Tim McCune Novice

          About a year ago, I implemented the EJB timer APIs on top of Quartz. I read the same comment that you did, so I submitted my implementation to JBoss as a patch. The link to this patch used to be at http://sourceforge.net/tracker/?func=detail&aid=881597&group_id=22866&atid=376687 but the page now says:
          ERROR
          Artifact: Only Group Members Can View Private ArtifactTypes

          So I thought maybe it had been moved to JIRA, but I can't find it there either. Last I knew, the patch was still open. Nobody appeared to do anything with it, or even comment on it. We've been using it in a JBoss cluster for about a year now and it works great. It's not a high-availability service; it runs on every node in the cluster. Quartz locks at the database level so the cluster node that ejbTimeout gets invoked on is pretty much random. This also means that there are no worries about what happens if one of your cluster nodes goes down.

          Today, I tried ripping it out and using the JBoss 4 timer implementation and was shocked at what a joke the JBoss implementation is. It doesn't appear to work in a clustered environment at all. It doesn't even appear to work across server restarts! The classloading is broken too. The "info" parameter I pass to createTimer is an object whose class is inside my ear. When JBoss starts up, it generates a ClassNotFoundException because the scheduler service is trying to deserialize the object long before my ear is deployed.

          I can repost my patch somewhere (maybe in JIRA) if anyone is interested.

          • 2. Re: Timer vs. cluster & scheduler
            Scott Stark Master

            Yes, repost it to jira please.

            • 4. Re: Timer vs. cluster & scheduler
              Barry Raczkowski Newbie

              Hi;

              I am newbe to the scheduling. This example is very interesting and I was trying to figure out how you implemented it. Currently, I am trying to implement a Quartz timer using a session bean. The project.xml where is it placed. Can you give me a little more information about this patch.? Please???