【发布时间】:2023-03-08 02:05:01
【问题描述】:
<int-sftp:outbound-gateway id="sftpOutBound"
session-factory="sftpSessionFactory" expression="payload" command="put" request-channel="outboundFtpChannel"
remote-directory="/tmp/tsiftp" reply-channel="sftpReplyChannel"/>
使用上面的xml,我可以发送文件并得到回复。在java中,如何在SftpOutboundGateway中设置远程目录。如果我使用SftpMessageHandler,是否有可能得到回复。注释代码正在传输文件但没有回复。
@Bean
@ServiceActivator(inputChannel = "outboundFtpChannel")
public MessageHandler transfertoPeopleSoft(){
/* SftpMessageHandler handler = new SftpMessageHandler(sftpSessionFactory());
handler.setRemoteDirectoryExpression(new LiteralExpression("/tmp/tsiftp"));
return handler;*/
SftpOutboundGateway sftpOutboundGateway = new SftpOutboundGateway( sftpSessionFactory(), "put", "/tmp/tsiftp");
sftpOutboundGateway.setOutputChannelName("sftpReplyChannel");
return sftpOutboundGateway;
}
Exception I am getting is
exception is org.springframework.expression.spel.SpelParseException: Expression [/tmp/tsiftp] @0: EL1070E: Problem parsing left operand
感谢您的帮助。
【问题讨论】:
标签: spring-integration spring-integration-sftp