我想使用Spring集成來設置remoteDirectoryExpression,下面的代碼我將它設置爲「headers。['remote_dir']」。但是,它顯示下面的錯誤。我如何編寫spEl來使其工作?謝謝。春季集成IntegrationFlow DSL for ftp
org.springframework.beans.factory.BeanCreationException:錯誤創建具有名稱豆 'ftpOut' 類路徑資源定義[COM/carrotit/CA /配置/ SpringIntegrationFtp.class]:通過工廠方法豆實例失敗;嵌套異常是org.springframework.beans.BeanInstantiationException:無法實例化[org.springframework.integration.dsl.IntegrationFlow]:工廠方法'ftpOut'拋出異常;嵌套異常是org.springframework.expression.spel.SpelParseException:EL1049E:(POS 7): '' 意外的數據之後: 'lsquare([)'
=========== ==代碼=====================
@Bean
public IntegrationFlow ftpOut() {
// String remoteDirectory = "/root/sub/subfolder/";
String remoteDirectoryExpression ="headers.['remote_dir']";
return IntegrationFlows.from(messageChannel())
.handle(Ftp.outboundAdapter(sessionFactory(), FileExistsMode.REPLACE).remoteDirectoryExpression(remoteDirectoryExpression)
.autoCreateDirectory(true))
.get();
}
謝謝你加里,刪除點後,它的作品。 –