简体   繁体   中英

Suggestions needed for request-reply on ActiveMQ and Camel using Spring NMS on .NET

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

看看这个模式和相关的单元测试 ...应该有所帮助

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM