camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: @Autowired, @EndpointInject, @ContextConfiguration
Date Fri, 10 Oct 2008 14:14:22 GMT
2008/10/10 cmoulliard <>:
> Hi,
> I have a quick question. Can I use @annotation to create a java class (which
> is not a TEST class) where I would like to start camelcontext, add endpoints
> and routes ?
> If the answer is yes, where can I find an example in camel-source ?
> Is there an annotation to define routes ?

You can create a RouteBuilder and have a spring.xml instantiate it
(either using component scanning or explicitly defining it in your
spring XML).

There's currently no way to create/instantiate a CamelContext via an
annotation though; it has to be done via the spring.xml right now.
Though if you implement CamelContextAware it'll be injected into your
bean if you want it.

You can then route endpoints using the Java DSL and either using URIs
to endpoints or injecting endpoints into your bean

Another approach if you have simple routes is to use POJO based
consuming or producing

there are some routing annotations too - e.g.


Open Source Integration

View raw message