The result I want to achieve is to start Camel context only after Spring
context.start() completes.

The solution with using camelContext autoStartup=false described
http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html
works with Camel 2.4.0 but fails to work with Camel 2.7.1. The way
autoStartup is implemented currently it duplicates the functionality that
can be achieved by setting autoStartup for all the routes. It looks like
currently there is no way to prevent Camel starting when Spring starts. The
change that drove to this was
https://issues.apache.org/jira/browse/CAMEL-3008.

I proppose that org.apache.camel.spring.SpringCamelContext#maybeStart should
check isAutoStartup and do nothing in case of false. This will allow to
start CamelContext later programmatically.

And it would be perfect if
org.apache.camel.spring.SpringCamelContext#onApplicationEvent proccessed the
org.springframework.context.event.ContextStartedEvent and started
CamelContext even if the isAutoStartup is false.



--
View this message in context: 
http://camel.465427.n5.nabble.com/camelContext-autoStartup-false-does-not-prevent-Camel-from-starting-when-Spring-context-starts-tp4421992p4421992.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to