0
當
我使用Spring集成的Java DSL v編譯出錯1.2.2及以下的一些例子我嘗試寫代碼來查詢一個文件夾輪詢 - 添加Files.inboundAdapter
return IntegrationFlows
.from(Files.inboundAdapter(new File("/tmp/foo")))
.handle((p, h) -> fileProcessor.process(p))
.get();
。此代碼無法編譯,因爲
"Cannot resolve method 'from(org.springframework.integration.dsl.
file.FileInboundChannelAdapterSpec)'"
這是如何解決的以及如何添加固定間隔輪詢?
阿爾喬姆,你能說清楚我應該使用哪些依賴關係嗎?我現在不得不使用compile(「org.springframework.boot:spring-boot-starter-integration:1.5.4.RELEASE」),我不得不使用直接類型集成IntegrationFlows.from((MessageSourceSpec ,?extends MessageSource >> )Files.inboundAdapter(directory) - 並且仍然獲得鏈接錯誤nowError:(105,38)java:can not access org.springframework.integration.file.FileReadingMessageSource not found。 –
當涉及到添加DSL支持時,Spring集成doc似乎非常糟糕它只建議添加不包括DSL的編譯(「org.springframework.integration:spring-integration-core:4.3.10.RELEASE」)。 –
您必須添加'Spring-Integration-file'。在Spring Integration中是獨立的jar,依賴項神器 –