Download

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
  xmlns:jms="http://servicemix.apache.org/jms/1.0"
  xmlns:amq="http://activemq.org/config/1.0">
  <!-- JBI CONTAINER -->
  <sm:container id="jbi" embedded="true" useMBeanServer="true"
  createMBeanServer="true" dumpStats="true" statsInterval="10"
  depends-on="jndi,broker">
  <sm:activationSpecs>
      <!-- JMS POLLER - CONSUMER -->
      <sm:activationSpec componentName="MyConsumer" service="foo:MyConsumer">
        <sm:component>
          <jms:component>
            <jms:endpoints>
              <jms:endpoint service="foo:MyConsumer"
                endpoint="MyConsumer"
                targetService="foo:MyProvider"
                targetEndpoint="MyProvider"
                role="consumer"
                defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                destinationStyle="topic"
                jmsProviderDestinationName="demo.org.servicemix.source"
                connectionFactory="#connectionFactory" />
            </jms:endpoints>

          </jms:component>
        </sm:component>
      </sm:activationSpec>
      <!-- JMS SENDER - PROVIDER -->
      <sm:activationSpec componentName="MyProvider" service="foo:MyProvider">
        <sm:component>
          <jms:component>
            <jms:endpoints>
              <jms:endpoint service="foo:MyProvider"
                endpoint="myProvider"
                role="provider"
                defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                destinationStyle="topic"
                jmsProviderDestinationName="demo.org.servicemix.result"
                connectionFactory="#connectionFactory" />
            </jms:endpoints>
          </jms:component>
        </sm:component>
      </sm:activationSpec>
    </sm:activationSpecs>
  </sm:container>
  <!-- JNDI BEAN -->
  <bean id="jndi"
    class="org.apache.xbean.spring.jndi.SpringInitialContextFactory"
    factory-method="makeInitialContext"
    singleton="true">
    <property name="entries">
      <map>
        <entry key="jms/ConnectionFactory" value-ref="connectionFactory" />
      </map>
    </property>
  </bean>
  <!-- FACTORY BEAN -->
  <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616" />
  </bean>
  <!-- BROKER BEAN -->
  <amq:broker id="broker" persistent="false" depends-on="jndi" >
    <amq:transportConnectors>
      <amq:transportConnector uri="tcp://localhost:61616" />
    </amq:transportConnectors>
  </amq:broker>
</beans>

  • No labels