Spring-integration SpEL:Logging将Message作为参数传递给方法

时间:2015-05-28 05:25:07

标签: spring spring-integration spring-el

我可以将Message作为参数传递给SpEL中的方法而不是标头或有效负载:

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

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:0)

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

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