tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <>
Subject Re: Cluster + @Schedule
Date Thu, 16 Oct 2014 10:32:59 GMT

about single execution: no magic a distibuted lock would work (can be
a database, hazelcast or whatever)

about cluster mode you just have to configure quartz in cluster mode
Romain Manni-Bucau
Twitter: @rmannibucau

2014-10-16 12:27 GMT+02:00 Leonardo K. Shikida <>:
> 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.
> Leo

View raw message