2013-02-07 76 views

回答

0

可以定义端点为每个ActiveMQ的实例:

<bean id="instance1" 
    class="org.apache.activemq.camel.component.ActiveMQComponent"> 
    <property name="brokerURL" value="tcp://server1:61616"/> 
</bean> 
... 
<bean id="instance2" 
    class="org.apache.activemq.camel.component.ActiveMQComponent"> 
    <property name="brokerURL" value="tcp://server2:61616"/> 
</bean> 

,然后用它在路线作为 <from uri="instanceX:myQueue"/><to uri="instanceX:myQueue"/>

+0

**非常感谢亚历克斯.... **我已经添加了这个,我试图添加如下组件: 'CamelContext aContext = new DefaultCamelContext(); ActiveMQComponent comp = ActiveMQComponent.activeMQComponent(“vm://”远程系统的IP地址“?broker.persistent = false”); aContext.addComponent(“jms”,comp);' 有了这个,我无法连接到队列.... –

+0

u能请帮助 –

+0

你需要像TCP指定网址://主机:端口而不是VM://远程连接。 –

相关问题