オペレーター intercept()

バージョン 5.3 以降、intercept() オペレーターを使用すると、フロー内の現在の MessageChannel に 1 つ以上の ChannelInterceptor インスタンスを登録できます。これは、MessageChannels API を介して明示的な MessageChannel を作成する代わりになります。次の例では、MessageSelectingInterceptor を使用して、例外を含む特定のメッセージを拒否します。

.transform(...)
.intercept(new MessageSelectingInterceptor(m -> m.getPayload().isValid()))
.handle(...)