您可以使用Java DSL。。。
@Bean
public IntegrationFlow filteringFlow() {
return IntegrationFlows.from("someChannel")
.filter("#jsonPath(...) matches ...")
.channel("outChannel")
.get();
}
或者用bean配置它。。。
@Bean
@ServiceActivator(inputChannel = "someChannel")
public MessageHandler filter() {
MessageFilter filter = new MessageFilter(selector());
filter.setOutputChannelName("outChannel");
return filter;
}
@Bean
public MessageSelector selector() {
return new ExpressionEvaluatingSelector("#jsonPath(...) matches ...");
}