【问题标题】:Spring-integration SpEL: Logging pass Message as a parameter to the methodSpring-integration SpEL:记录传递消息作为方法的参数
【发布时间】:2015-05-28 05:25:07
【问题描述】:

我可以将 Message 作为参数传递给 SpEL 中的方法,而不是 headers 或 payload:

    <logging-channel-adapter id="logger" channel="outputLoggingChannel" level="INFO" expression="T(xxx.XmlUtils).prettyPrint(message)" />

任何帮助将不胜感激。

【问题讨论】:

    标签: spring spring-integration spring-el


    【解决方案1】:

    通过传递 #root 作为参数,我们可以传递整个消息,包括标头和有效负载。

        <logging-channel-adapter id="logger" channel="outputLoggingChannel" level="INFO" expression="T(xxx.XmlUtils).prettyPrint(#root)" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-06
      相关资源
      最近更新 更多