消息增强器和 MEL

Message enricher and MEL

message enricher documentation使用一个术语"variable"例如

<flow name="orderProcessingFlow">
   <inbound-endpoint ref="orderEndpoint"/>
   <enricher target="#[variable:state]">
       <outbound-endpoint ref="stateLookup"/>
   </enricher>
   <outbound-endpoint ref="orderStep2"/>
</flow>

我没有找到关于该关键字的任何文档,我可以弄清楚它基本上添加了一个流变量,但还有更多内容吗? (没有关键字变量你会得到一个例外)

此外,文档中的 none 示例涉及丰富 "message headers" -- 我的假设是消息 headers 暗示出站属性是否正确?

如果相同的流程要添加出站 属性 它会是什么样子(这基于我的测试)

<flow name="orderProcessingFlow">
   <inbound-endpoint ref="orderEndpoint"/>
   <enricher target="#[message.outboundProperties.var]">
       <outbound-endpoint ref="stateLookup"/>
   </enricher>
   <outbound-endpoint ref="orderStep2"/>
</flow>

#[variable:state] 是旧表达式语法,自 3.3 起已弃用并由 MEL 取代。我认为 MEL 等价物是 #[flowVars.state]

同样,消息 "headers" 是过时的行话。您有不同范围的消息属性(入站、出站、flow/invocation 和会话)。

是的,您可以在流中设置的唯一属性是出站属性(入站属性由端点设置)。