-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files.inboundAdapter watchService - ignore subdirectories #3557
Comments
Why just don't use a plain polling behavior of the See docs for more info: https://docs.spring.io/spring-integration/docs/current/reference/html/file.html#watch-service-directory-scanner |
thank you for the reply. |
Well, one of them of course about walking through the whole file tree. There must not be any performance difference since both approaches are handled by the |
As discussed, I don't have a special use-case that warrants this behavior. But looking careful in the docs and reading, in fact, the source code itself for |
I think I find your suggestions reasonable, so we fix it in the next |
Fixes spring-projects#3557 * Expose a `watchMaxDepth` on the `FileReadingMessageSource` for its `Files.walkFileTree()` API usage * Add `watchDirPredicate` option ot the `FileReadingMessageSource` to skip sub-tree for `Files.walkFileTree()` scanning according to some condition against directory `Path`
* GH-3557: Add maxDepth, dirPredicate to FileReadMS Fixes #3557 * Expose a `watchMaxDepth` on the `FileReadingMessageSource` for its `Files.walkFileTree()` API usage * Add `watchDirPredicate` option ot the `FileReadingMessageSource` to skip sub-tree for `Files.walkFileTree()` scanning according to some condition against directory `Path` * Fix language in docs Co-authored-by: Gary Russell <grussell@vmware.com> --------- Co-authored-by: Gary Russell <grussell@vmware.com>
Expected Behavior
avoid listing the files from all subdirectoried
directory structure
would like to read all the files from
/workDir
and move them indone/failed
after processing. in my scenario it is not useful to scan the subdirectories. it is just taking time if the subdirectories contain a lot of files.i had a look in the
WatchServiceDirectoryScanner.walkDirectory
whereFiles.walkFileTree
is used. this has "int maxDepth". would it make sense to expose this?Current Behavior
current implementation would look for all files in all subdirectories.
Context
what i use now is
with the filter i can eliminate everything i do not need. it would be even better if the subdirectories were not scanned at all since in my case there are 10K -100K files
The text was updated successfully, but these errors were encountered: