尝试在我的骆驼路线中捕获来自 ActiveMQ 的响应

Trying to capture response from ActiveMQ in my camel route

我正在尝试使用蓝图创建骆驼路线,该蓝图在 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 实例,它侦听相同的队列并转储到日志,但这会引发错误,并且它一直在我的其他路由上混淆我的日志和解组对象。

我怎样才能做到这一点?

检查下面 link 中的答案。它应该为您提供有关如何为 request/reply 场景构建 active-mq uri 的提示。

Implement Request-Reply pattern using ActiveMQ, Camel and Spring