camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugo <>
Subject Spring context and camel context in the same time
Date Mon, 16 Apr 2012 14:18:08 GMT
Hello everyone,

Is it possible to use a camel context and a spring context (more precisely
an AnnotationConfigApplicationContext) in a same application ?

I explained myself : I'm trying to do 2 "simple" things.
- get beans (created by spring through the annotation @Named) file from a
java class (without injection) 
- scan packages to create beans from annotation (@Named)

I am not achieving do that neither using <context:component-scan base.../>
neither creating a new spring context...

I would like to create something like that (in addition of the existing
camelcontext defined in the xml file camel-context.xml) :

public MyClass {
  AnnotationConfigApplicationContext currentApplicationContext = new

and my config file :

public class BeanSpring {

	String MANDATORY_PROFILE = "test";
	String getProp() {

In my xml, I've just got :

  <bean id="prototypeRoutes"

  <camel:camelContext id="camel">
    <camel:routeBuilder ref="prototypeRoutes"/>

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

View raw message