JBoss 7.1.1 and EJB 3.1 Timer Service

I am thinking of porting a Spring Quartz application to EJB 3.1 to see if EJB has improved. I am having trouble understanding how a failure works with the schedule timer service. Quartz has database tables that use clustered instances of Quartz. If one of the nodes in your cluster fails, tasks will still run on other nodes.

I look at how the Timer Service works, and it seems to use the file system of the server on which the timer was created. It's true? I don’t see how this will be possible, since this will make the Timer service unusable, since it will not support switching to another resource.

So I have to miss something. Can anyone help me with this?

+4
source share
2 answers

The EJB timer service is simply not as advanced as Quartz (with or without Spring).

EJB timers are stored in an unknown location. It may be a file system, but it can also be a Windows registry if you are running Windows, or it could be an LDAP server or something else.

For some time there was a problem with the JJA EJB specification, and this was discussed on the specification mailing list, but then it was brutally reset and closed because no one bothered to answer anyone (perhaps because a lot of people were on vacation at that time) . This is one of the most compelling reasons to close the problem if you ask me, but I think that the lead specification should sometimes resort to such measures.

In any case, the built-in relational data source is stored in JBoss AS, which in turn writes to the file system. Through a proprietary configuration, you can point this data source to any remote database. The failure should also come from the functionality of JBoss. Although EJB prohibits many things for potential clustering, there is no explicit support for clustering in the specification, and thus EJB timers are not cluster aware.

+2
source

Not sure if this was available at the time of the question, but you can use "cluster-ha-singleton" for this, it allows you to create a single-point timer that is called from a single cluster node, in case of switching after the selected node fails, a new node is selected to run singleton (and therefore timers)

http://www.jboss.org/quickstarts/eap/cluster-ha-singleton/

It mentions EAP, but I work great on AS 7.2.0, banks are already included in / modules / org / jboss /

0
source

Source: https://habr.com/ru/post/1440290/


All Articles