从消息中获取队列名称
答
实际的JMS队列或主题在名为JMSDestination
的JMS头中可用。您可以将其作为名为JMSDestination
的骡子的指定消息属性提取。
生成的XML可能是这样的(这取决于事情是建立在你的最终的样子):
<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>