Apache camel 在xml中设置独立的ActiveMQ代理

Apache camel 在xml中设置独立的ActiveMQ代理,apache-camel,blueprint-osgi,camel-jms,Apache Camel,Blueprint Osgi,Camel Jms,我正在使用ApacheCamel作为路由引擎设置一个ServieMix实例,路由在blueprint.xml中定义。我试图将ActiveMQ配置为使我的蓝图与其他任何东西完全隔离(使用它自己的私有代理) 这是我的骆驼蓝图XML <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:cm="http://aries.ap

我正在使用ApacheCamel作为路由引擎设置一个ServieMix实例,路由在blueprint.xml中定义。我试图将ActiveMQ配置为使我的蓝图与其他任何东西完全隔离(使用它自己的私有代理)

这是我的骆驼蓝图XML

<?xml version="1.0" encoding="UTF-8"?>
<blueprint 
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>

    <bean id="record_ip" class="my.service.RecordIP"/>

    <bean id="jmsConnectionFactory" 
       class="org.apache.activemq.ActiveMQConnectionFactory">
       <property name="brokerURL" value="vm://myBroker?create=true&amp;waitForStart=10000" />
       <property name="userName" value="shadow"/>
       <property name="password" value="broker"/>
    </bean>

    <bean id="pooledConnectionFactory" 
       class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop">
       <property name="maxConnections" value="8" />
       <property name="connectionFactory" ref="jmsConnectionFactory" />
    </bean>

    <bean id="jmsConfig" 
       class="org.apache.camel.component.jms.JmsConfiguration">
       <property name="connectionFactory" ref="pooledConnectionFactory"/>
       <property name="concurrentConsumers" value="10"/>
    </bean>

    <bean id="activemq" 
        class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="configuration" ref="jmsConfig"/>
    </bean>

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

      <route id="tracing_route">
        <from uri="jetty:http://localhost:9696/trace"/>
        <inOnly uri="activemq:queue:ip_capture"/>
      </route>

      <route id="ip_capture">
        <from uri="activemq:queue:ip_capture?concurrentConsumers=1&amp;maxConcurrentConsumers=64&amp;maxMessagesPerTask=100"/>
        <bean ref="record_ip"/>
        <log message="Finished!" loggingLevel="WARN" />
      </route>
    </camelContext>

</blueprint>
amq代理是默认的代理

我正在翻遍所有我能找到的东西,但有些重要的东西不见了

  • 我不能使用
    xmlns:amq=”http://activemq.apache.org/schema/core“
    (ServiceMix无法解决此问题)

我正在使用

  • ServiceMix 7.0.0
  • ApacheCamel/camel蓝图2.16.4
  • activemq客户端/camel/blueprint 5.14.3

这么长的故事排序,我如何正确配置ActiveMQ,使我的蓝图与其他任何东西完全隔离?

我最终不需要这样做,因为无论出于何种目的,代理都是独立的,设置一个新的服务不会改变任何事情。

您可以在操作系统中将ActiveMQ作为服务安装,然后使用启动它。这样,它就完全不受卡拉夫的影响。您还可以检查它是如何嵌入的(
activemq-karaf
artifact似乎是一个很好的起点)@AlessandroDaRugna我的意思是独立于任何其他预先存在的(默认)代理,而不是独立于ServiceMix。据我所知,您的蓝图上下文设置了AMQ客户端,但不是代理本身。查看有关如何在Karaf(ServiceMix使用的OSGi容器)中启动代理的文档。
Could not refresh JMS Connection for destination 'ip_capture' - retrying in 5000 ms. Cause: Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Broker named 'amq-broker' does not exist.