简体   繁体   中英

Connecting to activeMQ using camel blueprint

I'm using Camel blueprint on JBoss Developer studio, which is a new challenge for me.

I've googled and found stuff like this: http://camel.apache.org/activemq.html but what I'm trying to figure out is how you define your activeMQ connection if you're using the blueprint. Everything references and activeMQ bean, but nothing shows how to define it in the blueprint.

You should create an ActiveMQComponent outside the the camel context :

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

    <bean id="activemq"
          class="org.apache.activemq.camel.component.ActiveMQComponent">
      <property name="brokerURL"
                value="tcp://localhost:61616" />
    </bean>

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      ...
    </camelContext>

</blueprint>

Note that this is described as "spring XML configuration" in http://camel.apache.org/activemq.html . The blueprint XML schema is mostly the same as the one for Spring (you can list main differences at http://camel.apache.org/using-osgi-blueprint-with-camel.html ), so in most case you can use what is described as "spring xml" in blueprint.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM