我有一个带有 JMS 请求-回复块的 Mule(3.5) 流。我看到所有进入回复队列的消息都会自动消耗。我想处理进入 jms 回复队列的消息。到目前为止,我已经尝试过 jms:selector 和 jms requester 模块,但没有运气。有什么办法可以做到这一点?
代码:
<mule>
<flow name="main" doc:name="main">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" path="test" port="2000" doc:name="HTTP"/>
<logger message="starting main flow" level="INFO" doc:name="Logger"/>
<request-reply storePrefix="mainFlow">
<jms:outbound-endpoint queue="StudioIN" connector-ref="Active_MQ1" exchange-pattern="one-way"/>
<jms:inbound-endpoint queue="StudioOUT" connector-ref="Active_MQ1" exchange-pattern="one-way">
<property key="selector" value="JMSCorrelationID='#[message.correlationId]'"/>
</jms:inbound-endpoint>
</request-reply>
</flow>
<flow name="worker" doc:name="worker">
<jms:inbound-endpoint queue="StudioIN" connector-ref="Active_MQ1" doc:name="JMS"/>
<async doc:name="Async">
<logger message="starting worker task(s) .... Payload: #[payload], Request: #[message.inboundProperties['http.request']]" level="INFO" doc:name="Logger"/>
<scripting:component doc:name="thread-sleep(10s)">
<scripting:script engine="Groovy">
System.out.println "about to sleep @ time" + System.currentTimeMillis()
Thread.sleep(10000);
System.out.println "done sleeping @ time" + System.currentTimeMillis()
</scripting:script>
</scripting:component>
<logger message="finishing up worker task(s) ...." level="INFO" doc:name="Logger"/>
</async>
</flow>
</mule>
我想处理回复队列 StudioOUT 的任何内容。有没有适当的方法来实现这一目标?