camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuhtz <>
Subject How to prevent routes from started twice?
Date Thu, 11 Jun 2009 15:33:07 GMT


I've a spring based web application that has 2 applicationContexts (the
second has the first as parent). My problem is that the SpringCamelContext
listens to the ContextRefreshedEvent and starts the camel context. 

This works fine if you have only 1 context but if the ContextRefreshedEvent
of the second context is received the routes are started a second time. 
The second start of the camel context is catched correctly (in
ServiceSupport) but I think the the startRoutes() in the start()-method of
DefaultCamelContext should also prevent to be called twice...

My config details: I start the camel context from another thread than that
one that creates the ApplicationContext and already I played with the
shouldStartContext set to false but this prevents the start the camel
context at all.
I know that my scenario with the different threads cause this problem but it
should be possible to prevent the automatic start with the
ContextRefreshedEvent but start the camel context manually.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message