int-ftp:outbound-gateway - 处理异常(文件已存在于GET上)

时间:2015-10-13 13:06:10

标签: spring-integration

我正在使用GITHUB中给出的int-ftp:outbound-gateway示例。 它为我工作。我面临的问题是:如果文件已存在于我的本地,它不会覆盖来自FTP的文件。它抛出以下错误并执行停止: 我想覆盖本地副本......有关如何处理这种情况的任何想法?

WARNING: failure occurred in gateway sendAndReceive
Throwable occurred: org.springframework.integration.MessagingException: Local file \TOPROCESS\UserLastLoginData2015-10-08.csv already exists
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.get(AbstractRemoteFileOutboundGateway.java:677)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway$2.doInSession(AbstractRemoteFileOutboundGateway.java:423)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway$2.doInSession(AbstractRemoteFileOutboundGateway.java:419)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:295)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.doGet(AbstractRemoteFileOutboundGateway.java:419)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.handleRequestMessage(AbstractRemoteFileOutboundGateway.java:381)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:142)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)

1 个答案:

答案 0 :(得分:0)

Starting with Spring Integration version 4.1.4,您可以在出站网关上设置mode="REPLACE"