0

blueprint.xml で定義されたルートを使用して、ルーティング エンジンとして apache-camel を使用して ServieMix インスタンスをセットアップしています。ブループリントが他のものから完全に分離されるように 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>

次のエラーが表示されるため、セットアップをまったく使用していないと思います

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.

amq-broker はデフォルトのブローカーです。

見つけられるものすべてを注ぎ込んでいるが、何か重要なものが欠けている

私は使っている

  • サービスミックス 7.0.0
  • apache-camel/camel-blueprint 2.16.4
  • activemq-client/camel/blueprint 5.14.3

長い話ですが、ブループリントが他のものから完全に分離されるように ActiveMQ を適切に構成するにはどうすればよいですか?

4

1 に答える 1