camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Persistent Aggregator in Clustered Environment
Date Mon, 24 Jan 2011 16:21:42 GMT
On Mon, Jan 24, 2011 at 9:11 AM, Sebastian Jancke
<> wrote:
> Hallo,
> what are your thoughts / ideas on the following scenario:
> An aggregator running with a jdbc-aggregation-repository against a shared database in
 a jboss-cluster. The aggregator has a completionPredicate and a completionTimeout. The aggregator
is used to correlate responses with requests and have a response-timeout. Timeouts are not
ignored, but further processed.
> Currently, I can theoretically come up with one problem: recovery happens on both machines,
thus timeouts can happen on both nodes "simultaneously" and get further processed. This will
get the system running into a collision, as the processing behind the aggregator is _not_
idempotent. Duplicates are sorted out before the aggregator.
> What are your thoughts / ideas on this?

The camel-jdbc-aggregator component could be extended to support a
locking feature used by recovery.
For example as Quartz would do in clustered mode with a shared database.

So its a matter of just implementing that in the scan method which the
recovery taks invokes.
So that only one invocation returns keys for entities to recover.

As a side note. I think its pants that Java / EE servers dont offer
better task scheduling features out of the box.
Frankly Camel should be able to leverage some API from javax. (eg
standard API / spec) where we just
register a task to be scheduled.
Then the container can handle this. Whether its a single JVM and a
clustered. An you got all the handles to control this.
If one node fail during executing the task, should the task by
restarted on the next node asap or whatnot. There is a bit of
complexity involved.
And you may have load balancing factors, so the task can be executed
at the node with the lowest load. Or you may prefer to run it at a
particular node.
And so on.

> -Sebastian
> --
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro!

Claus Ibsen
Twitter: davsclaus
Author of Camel in Action:

View raw message