在 .NET 上使用 Spring NMS 在 ActiveMQ 和 Camel 上进行请求回复所需的建议
我正在尝试使用 Spring 和 NMS 在 .NET 上使用 ActiveMQ 和 Camel(在代理中运行)。总的来说,这些组件工作得很好。我有一个用于发送/接收的骆驼路由,以及 .NET 中的一些代码来处理这个问题 - 就像一个魅力。
我试图解决的问题是请求-答复集成模式。 Camel 支持这一点,我的配置中有这个路由:
<route>
<from uri="activemq:foo"/>
<to uri="activemq:bar" pattern="InOut"/>
</route>
理论上,Camel 应该在这样的路由中设置 NMSReplyTo 和 CorrelationID,以便回复知道要返回到哪里。
我按照这篇非常有用的文章了解如何在 .NET 中将事物连接在一起。在本文中,代码显式设置了回复的位置,因为它没有使用 Camel。
我的问题是如何利用 Camel 路线,因此我基本上不必在代码中复制它(这会破坏基于配置的集成模式的目的)。我尝试删除代码中的 NMSReplyTo 和 CorrelationID,但回复永远不会返回给发件人。这几乎就像 Camel 路线没有被应用程序“内化”一样。
想法?建议?
谢谢, 切特
I am trying to use the ActiveMQ and Camel (running in broker) on .NET using Spring and NMS. In general, these components work brilliantly. I have a camel route for send/receive, and some code in .NET to handle this - works like a charm.
The issue I am trying to resolve is for a request-reply integration pattern. Camel support this, and I have this route in my config:
<route>
<from uri="activemq:foo"/>
<to uri="activemq:bar" pattern="InOut"/>
</route>
In theory, Camel is supposed to set the NMSReplyTo and CorrelationID in such a route so the reply knows where to go back to.
I followed this VERY helpful article to understand how to wire things together in .NET. In the article, the code explicitly sets the location of the reply, since it is not using Camel.
My question is how do I take advantage of the Camel route, so I don't have to essentially duplicate it in code (which would defeat the purpose of a config based integration pattern). I tried removing the NMSReplyTo and CorrelationID in my code, but the reply never gets back to the sender. It's almost like the Camel route is not 'internalized' by the application.
Thoughts? Suggestions?
Thanks,
Chet
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这个模式和相关的单元测试< /a>...应该有帮助
take a look at this pattern and the associated unit test...should help