2012-07-31 112 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>