Spring SFTP读取文件锁定 [英] Spring SFTP read file lock

查看:152
本文介绍了Spring SFTP读取文件锁定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经配置了Spring集成SFTP应用程序以从远程服务器轮询文件,并且如果它正在运行一个,它可以正常工作;如果同一应用程序运行了3次,则可以更快地处理文件,在这种情况下,同一个文件由两个人轮询应用程序,并导致重复的结果.我如何避免这种情况? Spring集成中可以使用任何文件锁定功能吗?

I have configured Spring integration SFTP application to poll file from remote server, and it's working fine if it's running one, where if the same application run's 3 time, to process the files faster, in such case same file is polled by two application's and resulting in duplicate results. how can i avoid this? is there any file locking available in Spring integration?

对于配置部分,您可以浏览此 SO

for configuration part you can look through this SO

推荐答案

您需要将持久文件列表过滤器与共享元数据存储一起使用-例如Redis 请参阅文档.

You need to use persistent file list filters together with a shared metadata store - e.g. Redis see the documentation.

此问题具有与FTP类似的设置.

This question has a similar setup for FTP.

这篇关于Spring SFTP读取文件锁定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆