davsclaus opened a new pull request, #30938: URL: https://github.com/apache/camel/pull/30938
# Description Part of [CAMEL-23832](https://issues.apache.org/jira/browse/CAMEL-23832). The umbrella ticket stays open. ## Summary This PR rewrites 20 texts of file-watch: the component description, 10 endpoint options (5 of them also component options, with the same text) and 9 headers. The CamelFileNameOnly header text was correct and stays. - The component description named `java.nio.file.WatchService`, but on macOS directory-watcher uses its own FSEvents-based watch service. It now says what the component does. - The CamelFileAbsolute, CamelFileAbsolutePath and CamelFilePath texts were copied from camel-file and spoke of relative paths and the `move` option. This consumer always sets `CamelFileAbsolute` to true and both path headers to the same absolute path, normalized with `/` as separator. - CamelFileName, CamelFileRelativePath and CamelFileNameConsumed now say that they hold the same path relative to the endpoint directory, and CamelFileLastModified gives its unit. - `fileHasher` and `useFileHashing` now say what the hashing drops (a MODIFY of a file whose hash did not change) and that the default Murmur3F hasher reads every file of the tree in full at start. `recursive=false` only drops events: the whole tree is still watched. `queueSize` gives the meaning of 0 or less and that a warning is logged once, `events` that the values are upper case without spaces, and `concurrentConsumers` that more than one thread can reorder the events. Sources: `FileWatchEndpoint`, `FileWatchComponent`, `FileWatchConsumer` and `FileWatchConstants`, and the sources of `io.methvin:directory-watcher` 0.19.1 (`DirectoryWatcher`, `PathUtils`, `FileHasher`). ### Found, not changed - The consumer sets the `CamelMessageTimestamp` header (the time the event was received), which the doc examples use, but `FileWatchConstants` does not document it. - `events` is parsed with `FileEventEnum.valueOf` without trimming, so `CREATE, MODIFY` fails the consumer at init. The option is a plain `String` without `enums`/`multiValue` metadata. - `pollThreads` greater than 1 calls `DirectoryWatcher.watchAsync` once per thread on the same watcher, and each call registers and hashes the whole directory tree again, so the start cost grows with the number of threads. - `recursive=false` is only a filter on the events: directory-watcher still registers and hashes all subdirectories. - The no-argument constructor of `FileWatchEndpoint` leaves `concurrentConsumers`, `pollThreads` and `queueSize` at 0 and `useFileHashing` at false, unlike the metadata defaults (1, 1, `Integer.MAX_VALUE`, true). The component always uses the other constructor, which copies the component values. ## Tests - There is no new test, as only description text changes. - A script compared the component JSON with the parent commit: only `description` fields changed (25 texts: 1 component, 5 component options, 10 endpoint options, 9 headers). # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I ran the formatter and built the module, then regenerated the catalog copy, `dsl/camel-endpointdsl` and `dsl/camel-componentdsl`, and committed all generated changes. # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
