2 Replies Latest reply on Oct 3, 2011 2:18 AM by davsclaus

    Starting Camel and ActiveMQ from spring

    johnwalker

      Hi,

       

      I'm having a maven multi-modules project. The modules (layers) in my eclipse project are:

       

      DAO, Service, Web, persistence, service, webservice, routing, model, amq.

       

      All are *jars* files, excepting the web module, which is a *war*.

       

      It's the war file that I aim then to deploy in JBoss. The war files is including all the modules libs above, as well as Camel and AMQ jars.

       

      *Questions*

       

      *1.* Is adding the following code into the *web.xml* file the right way to link the web module with the routing (camel) and amq (ActiveMQ) modules ? For e.g. doing something like:

       

      <context-param>

          <param-name>contextConfigLocation</param-name>

          <param-value>

          <!-- camel-->

          classpath:META-INF/routing/spring/camel-context.xml,

          <!-- amq -- >

          classpath:META-INF/activemq/spring/activemq-broker.xml

          </param-value>

      </context-param>

       

      2. How do I start automatically camel and amq from Spring from there ?

       

      2a. Are they both automatically when Spring start ?

       

      2b. Or should I add something like below in the config files referenced by the web.xml above ? Something like:

       

      activemq-broker.xml

       

           

       

      camel-context.xml

       

          <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring" autoStartup="true">

               

       

       

       

      Thank you for your help !

      J.