使用骆驼蓝图连接到 activeMQ

Connecting to activeMQ using camel blueprint

我在 JBoss Developer studio 上使用 Camel blueprint,这对我来说是一个新的挑战。

我用谷歌搜索并找到了类似这样的东西:http://camel.apache.org/activemq.html 但我想弄清楚的是,如果您使用的是蓝图,您是如何定义 activeMQ 连接的。一切都引用和 activeMQ bean,但没有显示如何在蓝图中定义它。

您应该在 camel 上下文之外创建一个 ActiveMQComponent :

<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>

请注意,这在 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) 中被描述为 "spring XML configuration",因此在大多数情况下,您可以使用蓝图中描述为 "spring xml" 的内容。