3 Replies Latest reply on Apr 30, 2012 10:01 AM by Daniel Bevenius

    How can i use switchyard camel with activemq?

    alex liu Newbie

      I get confused in  switchyard camel ,Mq in default is hornetQ,But I am interesting in how to use activemq with camel

        • 1. Re: How can i use switchyard camel with activemq?
          Daniel Bevenius Master



          I've not had time to try this out yet, but in theory you should be able to use a CDI to specify a method that creates an ActiveMQComponent:


          import javax.enterprise.context.ApplicationScoped;
          import javax.enterprise.inject.Produces;
          import javax.inject.Named;
          import org.apache.activemq.ActiveMQConnectionFactory;
          import org.apache.activemq.camel.component.ActiveMQComponent;
          public class ActiveMQComponentFactory {
              @Produces @Named ("activemq")
              public ActiveMQComponent createActiveMQComponent() {
                  final ActiveMQComponent ac = new ActiveMQComponent();
                  final ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
                  return ac;


          In SwitchYard CDI components are available to Camel's registry so you can specify 'activemq' in the uri as shown below:

          <camel:binding.camel configURI="activemq://TestQueue"/>






          • 2. Re: How can i use switchyard camel with activemq?
            Keith Babo Master

            In addition to what Dan posted, you will also need to add the activemq camel component and dependencies as modules in the AS7 distribution.


            I would be interested in hearing about how this turns out, so please post back with questions/results if you decide to try it yourself.  If not, we'll probably get around crafting an example sooner or later.