3 Replies Latest reply on Apr 30, 2015 2:23 PM by Jay SenSharma

    Connect MQ from switchyard

    laxman reddy poreddy Newbie

      I am new to switch yard application. Can any one provide example that connects MQ from switch yard composite services.

        • 1. Re: Connect MQ from switchyard
          Jay SenSharma Master

          You can refer to the following sample:  https://github.com/jboss-switchyard/quickstarts/tree/master/camel-jms-binding

           

          Something like this:

           

          <switchyard xmlns="urn:switchyard-config:switchyard:1.0">
              <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="camel-jms-binding" targetNamespace="urn:switchyard-quickstart:camel-jms-binding:0.1.0">
                  <service name="GreetingService" promote="GreetingService">
                      <jms:binding.jms xmlns:jms="urn:switchyard-component-camel-jms:config:1.0">
                          <jms:queue>GreetingServiceQueue</jms:queue>
                          <jms:connectionFactory>#ConnectionFactory</jms:connectionFactory>
                      </jms:binding.jms>
                  </service>
                  <component name="GreetingService">
                      <implementation.bean xmlns="urn:switchyard-component-bean:config:1.0" class="org.switchyard.quickstarts.camel.jms.binding.GreetingServiceBean"/>
                      <service name="GreetingService">
                          <interface.java interface="org.switchyard.quickstarts.camel.jms.binding.GreetingService"/>
                      </service>
                  </component>
              </composite>
          </switchyard>
          

          Where connection factory can be defined as:

           

             <bean id="ConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
                  <property name="brokerURL" value="tcp://localhost:61616" />
                  <property name="userName" value="karaf" />
                  <property name="password" value="karaf" />
              </bean> 
          
          • 2. Re: Connect MQ from switchyard
            laxman reddy poreddy Newbie

            Thanks Jay Kumar , but this quick start  is related to JMS queue not MQ . I am looking for IBM MQ example with switch yard.

            • 3. Re: Connect MQ from switchyard
              Jay SenSharma Master

              I did not try with IBM MQ but if you already have MQ setup done the i guess  you may try the same sample with IBM MQ connection Factory.  The pom you will need to change in order to include the ibm MQ dependencies.

               

                           <bean id="ConnectionFactory" class="com.ibm.mq.jms.MQConnectionFactory">
                                  <property name="transportType" value="1"/>
                                  <property name="hostName" value="localhost"/> 
                                  <property name="port" value="1414"/> 
                                  <property name="queueManager" value="Some_QueueManager"/>
                                  <property name="channel" value="Some_Channel"/> 
                          </bean>