从消息中获取队列名称 [英] Get queue name from message
本文介绍了从消息中获取队列名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用过m子3.
在我的流程中,我需要使用队列名称来添加选择.
In my flow I will need add choice by using queue name.
如何从xml文件中的消息中获取队列名称?
How can I get queue name from message in xml file?
谢谢!
推荐答案
实际的JMS队列或主题在名为JMSDestination
的JMS标头中可用.您可以从名为JMSDestination
的m子中将其提取为命名消息属性.
The actual JMS queue or topic is available in the JMS Header called JMSDestination
. You can extract this as the named message property from mule called JMSDestination
.
生成的XML可能看起来像这样(取决于您端的设置方式):
The resulting XML might look like this (depending on the way things are set up on your end):
<choice>
<when expression="message.inboundProperties['JMSDestination'].endsWith('.A')">
<!-- do something -->
</when>
<when expression="message.inboundProperties['JMSDestination'].endsWith('.B')">
<! -- do something else -->
</when>
<otherwise>
<! -- do the default -->
</otherwise>
</choice>
这篇关于从消息中获取队列名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文