2008-11-05 58 views
1

我正在嘗試設置activemq和mina的簡單演示。我編輯在activemq.xml中文件camelContext爲包括兩個米納TCP套接字,兩個隊列和路由作爲這樣:ActiveMQ使用mina設置tcp套接字

listenerA - > QA - > listenerB
listenerB - > QB - > listenerA

意圖應該在兩個telnet會話之間通過雙向路徑。稍後,我將添加更多特色功能,例如篩選,路由到某個主題以及我自己的編解碼器。

這裏是我的camelcontext:

<!-- You can use a <package> element for each root package to search for Java routes --> 
    <package>com.myco.codec</package> 

    <endpoint id="listener_A" uri="mina:tcp://localhost:42000?textline=true"/> 
    <endpoint id="listener_B" uri="mina:tcp://localhost:42001?textline=true"/> 

      <!-- You can use Spring XML syntax to define the routes here using the <route> element --> 
    <route> 
     <from ref="listener_A"/> 
     <to uri="activemq:qA"/> 
    </route> 
    <route> 
     <from uri="activemq:qB"/> 
     <to ref="listener_A"/> 
    </route> 
    <route> 
     <from ref="listener_B"/> 
     <to uri="activemq:qB"/> 
    </route> 
    <route> 
     <from uri="activemq:qA"/> 
     <to ref="listener_B"/> 
    </route> 
</camelContext> 

當我開始ActiveMQ的我得到一個異常:

org.apache.camel.NoSuchEndpointException:米娜:沒有端點可以爲找到TCP://localhost:42000?textline = true

我是否明確需要添加一個mina bean?如果是這樣以及如何?

回答

0

您是否在classpath上有camel-mina.jar和mina jars?

基於the thread here它似乎修復了它。

+0

該罐固定它。 (或者讓我通過另一個問題)。 – JeffV 2008-11-06 15:15:51