You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Enrico Olivelli <eo...@gmail.com> on 2012/07/15 09:42:06 UTC

Running Timers on cluster deployment

Hi,
I am wondering if is it possibile to use EjbTimer to run in a cluster 
environment in a way that only one JVM runs a ejbTimeout at scheduled time
I see you are using Quartz,
I'm using Quartz since years with JdbcJobStore, it is possible to synch 
timers in diffferent JVMs
http://terracotta.org/documentation/quartz-scheduler/installation-guide

I think that the real problem of OpenEJB is that there is now way to 
deploy the same app in more JVMs in one administration action, so there 
is no way to "synch" timers because there is no cluster management node 
(o something like that)

But assuming that we deploy exactly the same App in two (o more) JVMs 
would it not to be possibile to configure Quartz inside 
org.apache.openejb.core.timer.EjbTimerServiceImpl.java to use the same 
JdbcStore ?

Some configuration could be
<Container id="Default EjbTimer Service" type="TIMERSERVICE">
JobStoreType:  jdbc
DataSource: MyQuartzDataSource
LocalSchedulerId: instance1scheduler
</Container>

In GF3.1.2 if you want clustered timers you have to configure a global 
shared DataSource for the EJBTimerService

The only workaround for me is to:
- use an external ActiveMQ
- use ejbTimer to put at scheduled a message on a queue  (with a system 
property I let only ejbtimeout to something in one jvm)
- let a MDB take a message from that queue (only one mdb in the cluter 
will take that message)
it is a very poor solution, there is not way to guarantee that this fake 
ebjtTimeout whith MDB is not executed twice in parallel

thanks
Enrico




Re: Running Timers on cluster deployment

Posted by Enrico Olivelli <eo...@gmail.com>.
I think it will be fine
I'll try as soon as I can




Il 15/07/2012 18:18, Romain Manni-Bucau ha scritto:
> did  https://issues.apache.org/jira/browse/OPENEJB-1867
>
> does it help?
>
> - Romain
>
>
> 2012/7/15 Enrico Olivelli <eo...@gmail.com>
>
>> Hi,
>> I am wondering if is it possibile to use EjbTimer to run in a cluster
>> environment in a way that only one JVM runs a ejbTimeout at scheduled time
>> I see you are using Quartz,
>> I'm using Quartz since years with JdbcJobStore, it is possible to synch
>> timers in diffferent JVMs
>> http://terracotta.org/**documentation/quartz-**
>> scheduler/installation-guide<http://terracotta.org/documentation/quartz-scheduler/installation-guide>
>>
>> I think that the real problem of OpenEJB is that there is now way to
>> deploy the same app in more JVMs in one administration action, so there is
>> no way to "synch" timers because there is no cluster management node (o
>> something like that)
>>
>> But assuming that we deploy exactly the same App in two (o more) JVMs
>> would it not to be possibile to configure Quartz inside
>> org.apache.openejb.core.timer.**EjbTimerServiceImpl.java to use the same
>> JdbcStore ?
>>
>> Some configuration could be
>> <Container id="Default EjbTimer Service" type="TIMERSERVICE">
>> JobStoreType:  jdbc
>> DataSource: MyQuartzDataSource
>> LocalSchedulerId: instance1scheduler
>> </Container>
>>
>> In GF3.1.2 if you want clustered timers you have to configure a global
>> shared DataSource for the EJBTimerService
>>
>> The only workaround for me is to:
>> - use an external ActiveMQ
>> - use ejbTimer to put at scheduled a message on a queue  (with a system
>> property I let only ejbtimeout to something in one jvm)
>> - let a MDB take a message from that queue (only one mdb in the cluter
>> will take that message)
>> it is a very poor solution, there is not way to guarantee that this fake
>> ebjtTimeout whith MDB is not executed twice in parallel
>>
>> thanks
>> Enrico
>>
>>
>>
>>



Re: Running Timers on cluster deployment

Posted by Romain Manni-Bucau <rm...@gmail.com>.
did  https://issues.apache.org/jira/browse/OPENEJB-1867

does it help?

- Romain


2012/7/15 Enrico Olivelli <eo...@gmail.com>

> Hi,
> I am wondering if is it possibile to use EjbTimer to run in a cluster
> environment in a way that only one JVM runs a ejbTimeout at scheduled time
> I see you are using Quartz,
> I'm using Quartz since years with JdbcJobStore, it is possible to synch
> timers in diffferent JVMs
> http://terracotta.org/**documentation/quartz-**
> scheduler/installation-guide<http://terracotta.org/documentation/quartz-scheduler/installation-guide>
>
> I think that the real problem of OpenEJB is that there is now way to
> deploy the same app in more JVMs in one administration action, so there is
> no way to "synch" timers because there is no cluster management node (o
> something like that)
>
> But assuming that we deploy exactly the same App in two (o more) JVMs
> would it not to be possibile to configure Quartz inside
> org.apache.openejb.core.timer.**EjbTimerServiceImpl.java to use the same
> JdbcStore ?
>
> Some configuration could be
> <Container id="Default EjbTimer Service" type="TIMERSERVICE">
> JobStoreType:  jdbc
> DataSource: MyQuartzDataSource
> LocalSchedulerId: instance1scheduler
> </Container>
>
> In GF3.1.2 if you want clustered timers you have to configure a global
> shared DataSource for the EJBTimerService
>
> The only workaround for me is to:
> - use an external ActiveMQ
> - use ejbTimer to put at scheduled a message on a queue  (with a system
> property I let only ejbtimeout to something in one jvm)
> - let a MDB take a message from that queue (only one mdb in the cluter
> will take that message)
> it is a very poor solution, there is not way to guarantee that this fake
> ebjtTimeout whith MDB is not executed twice in parallel
>
> thanks
> Enrico
>
>
>
>