camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henryk Konsek <>
Subject Re: Camel-boot autowiring issue
Date Thu, 06 Nov 2014 09:32:16 GMT

> OK, I can see possible improvement for camel-spring-boot, as well as
> small misconfiguration in your project. I'll send more details later
> today. Stay tuned :)

I tuned the camel-spring-boot code to postpone the moment of injecting
routes until all beans are initialized. This will help to deal with
the situations when you inject CamelContext into the configuration
creating RoutesBuilder. To be honest this kind of injection
(CamelContext into the RoutesBuilder or its config file) is rather the
anti-pattern IMHO as routes builders shouldn't be aware of  the
CamelContext, but after my improvement it is possible.

All you need to change in your example now is to swap config files order:

@SpringApplicationConfiguration(classes =
{CamelConfigurationTest.class, CamelConfiguration.class})
... instead of ...
@SpringApplicationConfiguration(classes = {CamelConfiguration.class,

You need to load test config before the regular configuration. This is
general rule for Spring Java configurations.

Let me know if it works for you with new snapshot and swapped configs.
Works like a charm on my machine [1] :) . Ping me in case of any
additional problems.


PS Give a moment for our CI server to deploy new snapshots or build it
locally from the master branch.


Henryk Konsek

View raw message