Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Route policy for clustered servicemix/camel based on hazelcast locks

$
0
0
Hello everyone,

I’m new to camel and I’m trying to develop a route policy that insures a
single instance execution of a route in a clustered servicemix /camel. The
policy will be used for endpoints that don’t manage concurrent access such
as IMAP.

For the policy I opted for a lock mechanism based on Hazelcast, but I’m not
sure when (in the route lifecycle) shall the lock occur and what part of the
route is the most suitable to stop (rout, endpoint, consumer). I tested
stopping the route and the consumer.

To sum up what i understood and my tests :

onInit() -> the route and the consumer aren’t started yet so the lock and
stop aren’t useful here. I also tried an autoStart=false, so that I can
start the route in the onInit() but that didn’t work.

onStart()-> the route/consumer are already started so maybe stopping them
here is not the most appropriate manner.

Do you have any advice on when shall the lock occur and on which part of the
route is the most appropriate to stop?

Thank you in advance,

-Bashar

Viewing all articles
Browse latest Browse all 5648

Trending Articles