camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Camel, Spring and Initialization
Date Fri, 02 Apr 2010 10:39:32 GMT
On Thu, Apr 1, 2010 at 11:00 PM, greenstar <> wrote:
> I am using Camel with Spring like follows:
> <camelContext xmlns="">
>    <routeBuilder ref="routeBuilder1"/>
>    ...
> </camelContext>
> I'm looking for a way to run some code before the route builders are run.
> This seems like it should be straightforward.  I've tried the @PostConstruct
> (with CommonAnnotationBeanPostProcessor).  I've also tried
> ApplicationContextEvent.  These initialization hooks all work, but they are
> all executed *after* the RouteBuilder.configure() methods are called.

The code to run before is that in the RouteBuilder class? Or is it
defined as a spring bean etc.?

> How does the <camelContext> tag integrate into Spring and how can I specify
> the initialization order of my own beans relative to it?

In Spring XML you can use the depends-on attribute in the <bean> tag.

I wonder if we need to add it to <camelContext> as well so you can
have Camel depend upon other beans.

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

Claus Ibsen
Apache Camel Committer

Author of Camel in Action:
Open Source Integration:

View raw message