1 Reply Latest reply on Feb 27, 2015 2:54 PM by Akram KAMMOUN

    Spring CDI (beans.xml) in switchyard project

    Akram KAMMOUN Newbie



      I am currently working on a project using the fuse service works (switchyard, ....). I have created a Spring XML configuration file (src/main/resources/META-INF/beansCDI.xml) which contains the CDI beans (beans, camelContext, ...) that i want to inject. The issue that I cannot retrieve the beans defined in beansCDI.xml to inject them in my camel route (route.xml). Also, I have tried to use ApplicationContext to load beansCDI.xml but without success. Note that using annotations (@Produces @Named) to inject beans works perfectly. But, in my case i want to use the spring DSL.


      Here my beansCDI.xml [example taken from the "Camel in Action" book]:

      <beans xmlns="http://www.springframework.org/schema/beans"


          xsi:schemaLocation=" http://www.springframework.org/schema/beans





          <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">

              <property name="connectionFactory">

                  <bean class="org.apache.activemq.ActiveMQConnectionFactory">

                      <property name="brokerURL" value="vm://localhost" />





          <bean id="ftpToJmsRoute" class="camelinaction.FtpToJMSRoute" />


          <camelContext xmlns="http://camel.apache.org/schema/spring">

              <routeBuilder ref="ftpToJmsRoute" />




      Any suggestions would be grateful.

      Thank you.