我正在使用Camel Blueprint xml DSL进行ActiveMQ消息关联,我需要实现以下目标,
InOut
模式后从本地(主机A)Apache ActiveMQ队列(“ XYZ”)中提取消息并将消息放入远程(主机B)Apache ActiveMQ(“ ABC”)队列中,useMessageIDAsCorrelationID
和replyTo
作为“ DEF”(在远程主机Host B上定义)排队问题
请告知我应该如何使用匹配的JMSCorrelationID配置路由以接收答复队列(即“ DEF”)的响应。
到目前为止,我所说的路线是:
<route id="test5">
<from id="test-from5" uri="jms:queue:XYZ?connectionFactory=amqConnectionFactory"/>
<log id="test-log5" message=" Transferring to queue"/>
<log id="test" message="Request Message Body : ${body}" />
<log message="Request JMSMessageID : ${in.header.JMSMessageID}" />
<setHeader headerName="JMSCorrelationID" id="_setHeader3">
<simple>${in.header.JMSMessageID}</simple>
</setHeader>
<log message="Request JMSCorrelationID : ${in.header.JMSCorrelationID}" />
<to id="_to5" uri="jms:queue:ABC?connectionFactory=amqConnectionFactoryABC&exchangePattern=InOut&replyTo=DEF&useMessageIDAsCorrelationID=true"/>
<log message="Message sent successfully" />
<log message="Response JMSMessageID : ${in.header.JMSMessageID}" />
<log message="Response JMSCorrelationID : ${in.header.JMSCorrelationID}" />
<log message="Response Message Body : ${in.body}" />
</route>