使用 mina 的 ActiveMQ 设置 TCP 套接字
我正在尝试设置 activemq 和 mina 的简单演示。 我编辑了 activemq.xml 文件中的camelContext,以包含两个 mina tcp 套接字、两个队列和路由,如下所示:
listenerA -> qA-> 监听者B
监听器B -> qB-> ListenerA
目的是在两个 telnet 会话之间进行双向传递。 稍后,我将添加更多奇特的功能,例如过滤、路由到主题以及每个侦听器上我自己的编解码器。
这是我的骆驼上下文:
<!-- 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: No endpoint can be find for: mina:tcp://localhost:42000?textline=true
我是否明确需要添加 mina bean? 如果是的话,在哪里以及如何进行?
I am trying to setup a simple demo of activemq and mina. I edited the camelContext in the activemq.xml file to include two mina tcp sockets, two queues and routes as such:
listenerA -> qA -> listenerB
listenerB -> qB -> listenerA
The intent is to have two way pass through between two telnet sessions. Later, I will add more fancy features such as filtering, routing to a topic and my own codec on each listener.
Here is my 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>
When I start activemq I get an exception:
org.apache.camel.NoSuchEndpointException: No endpoint could be found for: mina:tcp://localhost:42000?textline=true
Do I explicitly need to add a mina bean? If so where and how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的类路径上有camel-mina.jar 和mina jar 吗?
基于此处的线程 似乎已经修复了它。
Do you have camel-mina.jar and the mina jars on the classpath?
Based on the thread here it seems to have fixed it.