我正在尝试使用Spring Integration来设置remoteDirectoryExpression,在代码下面我将其设置为“headers。['remote_dir']”。但是,它显示以下错误。如何编写spEl以使其工作?感谢。
org.springframework.beans.factory.BeanCreationException:在类路径资源[com / carrotit / ca / config / SpringIntegrationFtp.class]中定义名称为'ftpOut'的bean时出错:通过工厂方法的Bean实例化失败;嵌套异常是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();
}