2008-11-05 59 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