2013-02-07 79 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://遠程連接。 –

相關問題