You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tom Howe <to...@artcore.com> on 2012/01/27 13:49:01 UTC

Adding a RouteBuilder to a spring configured CamelContext.

Hi,
Is it possible to use SingleRouteCamelConfiguration to add a route to
an camelContext that is already created by Spring?

When I try, I get 2 camelContexts. I tried to provide the spring
camelContext to SingleRouteCamelConfiguration like this:

    @Autowired
    CamelContext camelContext;

    @Override
    protected CamelContext createCamelContext() throws Exception {
        return camelContext;
    }

but this throws a NullPointerException. I'm guessing
createCamelContext is called in the constructor but it's not
documented well.

Maybe there is a better approach? Why am I doing this? Because I cant
seem to get the <delay> <method/></delay> using spring as per my other
post.

Thanks, Tom