【问题标题】:Get queue name from message从消息中获取队列名称
【发布时间】:2012-08-01 05:46:47
【问题描述】:

我用过 mule 3。

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

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

谢谢!

【问题讨论】:

    标签: mule


    【解决方案1】:

    实际的 JMS 队列或主题在名为 JMSDestination 的 JMS 标头中可用。您可以从名为 JMSDestination 的 mule 中将其提取为命名的消息属性。

    生成的 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-13
      • 2013-02-18
      • 2018-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-13
      相关资源
      最近更新 更多