我有一个问题,我想实现使用DSL春季集成的输入适配器,作为一个事件监听器,并重定向从该事件侦听器消息的通道。
所需的代码:
@Bean
public IntegrationFlow listenerFlow() {
return IntegrationFlows.from(InputAdapterListener.listen())
.channel("ChannelXYZ")
.get();
}
可有人向我解释,这将是InputAdatperListener类的实现来支持这样的行为,或者寻找一些例子吗?
有一个在ApplicationEventListeningMessageProducer
为您在spring-integration-event
配置使用from()
:
private ApplicationListener<?> applicationListener() {
ApplicationEventListeningMessageProducer producer = new ApplicationEventListeningMessageProducer();
producer.setEventTypes(TestApplicationEvent1.class);
producer.setOutputChannel(resultsChannel());
return producer;
}
...
IntegrationFlows.from(applicationListener())
而这一次将被自动注册为一个bean。