[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Quartz with cluster and JobExecutionException  XML
Forum Index -> Quartz
Author Message
anatolyg

neo

Joined: 03/27/2012 07:17:24
Messages: 4
Offline

We run quartz 1.8.4 in a cluster with following quartzProperties:

<prop key="org.quartz.jobStore.misfireThreshold">60000</prop>
<prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop>
<prop key="org.quartz.jobStore.isClustered">true</prop>
<prop key="org.quartz.jobStore.clusterCheckinInterval">20000</prop>

We have 2 nodes in cluster (Node 1 and Node 2)

We have trigger that each 30 seconds execute the same job on one of the nodes.
The quartz performs random distribution of jobs between 2 nodes and it is OK.

Here is use case:

1) Node 2 is down.
2) Jobs is triggered on Node 1 for several time
3) We start Node 1 and immediately it receive trigger to execute job….

We would like to avoid this for first 60 minutes.
We would like that job will be triggered on Node 1 first.

So, when executeInternal is called on ‘Node 2’ we fire exception with flag refireImmediately = true

throw new JobExecutionException(true);

Question:

Can we expect that after one node call “throw new JobExecutionException()” the next time quartz will trigger job on another node or it still randomly?
What is another option to cause Quartz to select Node as we prefer?
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1654
Online


The refire immediately flag *only* causes an immediate new call to execute() method on the same node.

Targeting of nodes (per trigger) can be achieved with Quartz Where features of Terracotta Clustered Quartz.
anatolyg

neo

Joined: 03/27/2012 07:17:24
Messages: 4
Offline

You mean Terracotta commercial versions.
I see.

And what about not comercial version.

Is it any option to avoid load balancing in cluster mode?
I want to reach Active/Pasive mode of cluster.
I would like the same node will always take all jobs till node is not down and only when down another node will take jobs.

May be latest version of Quartz allow such functionality?

Thanks.

jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1654
Online

No, there is not currently a "passive" mode, only active-active.

Probably wouldn't be too hard to add to JDBC JobStore, if someone had the time and inclination.
anatolyg

neo

Joined: 03/27/2012 07:17:24
Messages: 4
Offline

So, when executeInternal is called on ‘Node 2’ and we fire exception with flag refireImmediately = false, like throw new JobExecutionException();

Does it mean that next time job will be trigered on this 'Node 2' or randomally on any Node?
(To clarify if it is any difference if executeInternal just return or throw new JobExecutionException(false))

2. Active/Active supported.
Active-Pasive NOT supported.
Is it any way to reach 100% round-robin or it is only Randomly behaviour?

Thanks

jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1654
Online


1- Refire via the refireImmediately flag will ALWAYS happen on the same node

2- Round-robin is not supported. Something very near approaching round-robin is supported by Quartz Where (commercial).
anatolyg

neo

Joined: 03/27/2012 07:17:24
Messages: 4
Offline

To clarify if it is any difference if executeInternal just return or throw new JobExecutionException(false).


1) If executeInternal just return than next time job will be trigered randomally on one of nodes.

2) If executeInternal throw new JobExecutionException()
with refireImmediately = true OR refireImmediately = false
then next time job will be trigered on the same node.




jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1654
Online


If you throw an exception with refireImmediately == false, then the next scheduled firing of that trigger will happen on any random node.
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team