activemq5.15.5,camel-activemq-component-brokerurl连接两个独立的代理

2w3rbyxf  于 2021-07-14  发布在  Java
关注(0)|答案(0)|浏览(198)

我有两个独立的代理使用来自另一个系统的消息。
客户机使用者使用camel来使用消息,下面是它使用的配置部分 camel-activemq 组件。
我试图在borkerurl中提供主机信息,但是抛出了一些异常。使用springcore4.2.4、springboot:1.3.1、activemqcamel:5.12.1、activemqbroker:5.12.1等jar。

...

  <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="(tcp://host1:61616,tcp://host2:61616)?wireFormat.maxInactivityDuration=500000" />
  </bean>

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

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

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

当我使用上下文运行camel main时,进程抛出异常。

:PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'brokerURL' threw exception; nested exception is java.lang.IllegalArgumentException: Invalid broker URI: (tcp://host1:61616,tcp://host2:61616)?wireFormat.maxInactivityDuration=500000

有没有办法传入两个独立代理的borker url?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题