【发布时间】:2021-07-15 03:26:27
【问题描述】:
我有两个独立的代理正在使用来自另一个系统的消息。
客户端消费者使用Camel来消费消息,下面是使用camel-activemq组件的部分配置。
我试图在 borkerURL 中提供主机信息,但抛出了一些异常。 使用罐子 弹簧芯4.2.4, 弹簧启动:1.3.1, activemq 骆驼:5.12.1, activemq-broker:5.12.1等
...
<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>
...
当我使用上下文运行骆驼主程序时,进程抛出异常。
: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?
【问题讨论】:
标签: spring apache-camel activemq spring-camel