试图在我的骆驼路线中捕捉ActiveMQ的响应

时间:2016-06-27 17:47:32

标签: java apache-camel activemq

我正在尝试使用蓝图创建一个camel路由,该蓝图在activeMQ队列上发送消息,然后侦听请求中创建的临时队列上的响应。这似乎很基本,但我找不到一个利用它的例子。

我尝试过搜索和阅读文档,以及我发现的内容: http://camel.apache.org/jms.html http://camel.apache.org/exchange-pattern.html http://camel.apache.org/request-reply.html https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/EIP_Transaction_Guide/files/FMRTxnJMSSynchronous.html http://kosalads.blogspot.com/2014/04/ApacheCamelRequestReplyPatternWithJavaDS.html http://grokbase.com/t/camel/users/128n88xeva/how-to-use-request-reply-in-jms http://camel.465427.n5.nabble.com/ExchangePattern-InOut-I-Can-t-get-any-response-td5056301.html https://examples.javacodegeeks.com/enterprise-java/apache-camel/apache-camel-exchange-example/

这令人沮丧。

我设置了activeMQ组件:

<to pattern="InOut" uri="activemq:queue:tripRequest.updateStatus.v1.0?useMessageIDAsCorrelationID=true"/>
<log message="Update Status responded ${out.body}"/>

日志显示输入XML,这让我感到惊讶。在检查了文档之后,我创建了一个新的activeMQ实例,该实例侦听同一个队列并转储到日志中,但这会引发错误并且它会在我的其他路径上混合我的日志和解组对象。

我该如何做到这一点?

1 个答案:

答案 0 :(得分:0)

检查以下链接中的答案。它应该为您提供有关如何为请求/回复方案构建active-mq uri的提示。

Implement Request-Reply pattern using ActiveMQ, Camel and Spring

相关问题