tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo K. Shikida" <shik...@gmail.com>
Subject Cluster + @Schedule
Date Thu, 16 Oct 2014 10:27:46 GMT
Hi

this doubt may sound dumb, but if I have an EJB with a scheduled task like

    @Schedule(dayOfWeek = "*")
    public void runMeDaily() {...}

and if I am in a clustered environment, is there any way to make this job
run in only one of the instances? (only once)

of course, I can set a flag somewhere and check it before the execution of
such task, so only the first cluster instance would run it, but I am
curious if it's possible using some configuration magic.

another doubt is: if I have 2 clustered tomee instances, how do I make both
point to the same scheduler? By scheduler I mean something like

Scheduler scheduler = new StdSchedulerFactory().getScheduler("myScheduler");

My feeling is that my cluster will need a centralized quartz scheduler
service somehow, so if there's some way to do that using tomee, it would be
useful for me.

TIA

Leo

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message