Spring Integration DSL FTP

huangapple go评论73阅读模式
英文:

Spring Integration DSL FTP

问题

我有Spring用于FTP的入站流

我正在查看文档

https://docs.spring.io/spring-integration/reference/html/ftp.html

如果本地目录中有一个或多个文件,它会在与远程FTP服务器进行通信之前处理这些文件。

上述内容具体是什么意思?

例如,在我的情况下,本地目录是其他流程将要接收的目录。例如,该目录中有5个文件,尚未被其他流程接收。

为什么FTP适配器会尝试再次处理它们,它究竟会做什么?我如何停止这个过程?

英文:

I have Spring inbound for the FTP

I am looking at the document

https://docs.spring.io/spring-integration/reference/html/ftp.html

If you happened to have one or more files sitting in the local-directory,
it would process those files before it would initiate communication with the remote FTP server.

What exactly the above means?

For example, in my case, local directory is the one which other flow will pick up from. For example, I have 5 files in that directory that have not been picked up by other flow.

Why would FTP adaptor try to process them again and what exactly it will do? How can I stop that?

答案1

得分: 1

看起来你没有仔细阅读FTP入站通道适配器的文档:https://docs.spring.io/spring-integration/reference/html/ftp.html#ftp-inbound

这个组件的作用是将远程文件下载到它们的本地副本。这就是为什么我们在这里提到本地目录,并且通道适配器上有一个选项。关键是,这个通道适配器会将远程文件下载到本地目录,然后才会构建一个带有本地文件的消息发送到channel。你绝对不应该干预其他组件来在本地目录中执行任何操作。文档中说,如果本地目录中已经有一些文件,它们会首先作为有效负载发布,然后才会这个通道适配器采取路由来获取远程文件。

除非在处理后删除这些文件,否则你无法停止这个逻辑。尽管你可以使用流式入站通道适配器来代替:https://docs.spring.io/spring-integration/reference/html/ftp.html#ftp-streaming

英文:

It looks like you didn't ready FTP Inbound Channel Adapter docs carefully: https://docs.spring.io/spring-integration/reference/html/ftp.html#ftp-inbound

This one is that type of components which downloads remote files to their local copy.
That's why we talk here about a local directory and there is an option on that channel adapter. The point is that this channel adapter downloads remote files into local dir and only after that it builds a message with a local file to send into a channel. You definitely should not interfere with other components to do anything in this local dir. The statement says that if there are some files in that local dir already, they are published as payload first and only then this channel adapter takes a route for fetching remote files.

You cannon stop this logic, unless you remove those files after processing. Although you can use a Streaming Inbound Channel Adapter instead: https://docs.spring.io/spring-integration/reference/html/ftp.html#ftp-streaming

huangapple
  • 本文由 发表于 2020年1月3日 19:50:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/59578124.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定