Configuring different JMS providers - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

You can configure your JMS provider in Spring XML as follows:

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
   <jmxAgent id="agent" disabled="true"/>
</camelContext>

<bean id="activemq" 
   class="org.apache.activemq.camel.component.ActiveMQComponent">
   <property name="connectionFactory">
      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
         <property name="brokerURL" value=
            "vm://localhost?broker.persistent=false&broker.useJmx=false"/>
      </bean>
   </property>
</bean>

Basically, you can configure as many JMS component instances as you wish and give them a unique name using the id attribute . The preceding example configures an activemq component. You could do the same to configure MQSeries, TibCo, BEA, Sonic and so on.

Once you have a named JMS component, you can then refer to endpoints within that component using URIs. For example for the component name, activemq, you can then refer to destinations using the URI format, activemq:[queue:|topic:]destinationName. You can use the same approach for all other JMS providers.

This works by the SpringCamelContext lazily fetching components from the Spring context for the scheme name you use for Endpoint URIs and having the Component resolve the endpoint URIs.