Can't find an example anywhere using spring integration DSL only xml. Any pointers appreciated, also need the poller to trigger on file creation and modification
答案 0 :(得分:2)
这个怎么样:
@Bean
public IntegrationFlow fileReadingFlow() {
return IntegrationFlows
.from(s -> s.file(tmpDir.getRoot()).patternFilter("*.sitest"),
e -> e.poller(Pollers.fixedDelay(100)))
.transform(Transformers.fileToString())
.channel(MessageChannels.queue("fileReadingResultChannel"))
.get();
}
?
.from()
工厂方法在此接受MessageSources
工厂,您使用.file()
工厂方法等等。