FunctionExpression

ラムダと generics を使用できるようにするため、FunctionExpression クラス(SpEL の Expression インターフェースの実装)を導入しました。Function<T, R> オプションは、Core Spring Integration から暗黙的な Strategy バリアントが存在する場合、expression オプションとともに DSL コンポーネントに提供されます。次の例は、関数式の使用方法を示しています。

.enrich(e -> e.requestChannel("enrichChannel")
            .requestPayload(Message::getPayload)
            .propertyFunction("date", m -> new Date()))

FunctionExpression は、SpelExpression で行われているように、ランタイム型変換もサポートしています。