2012-07-31 184 views
0

我已经使用了mule 3.从消息中获取队列名称

在我的流程中,我将需要使用队列名称添加选项。

如何从xml文件中的消息获取队列名称?

谢谢!

回答

3

实际的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>