How can Apache Camel be used to monitor file changes?

后端 未结 5 1779
孤街浪徒
孤街浪徒 2020-12-10 02:09

I would like to monitor all of the files in a given directory for changes, ie an updated timestamp. This use case seems natural for Camel using the file component, but I can

5条回答
  •  猫巷女王i
    2020-12-10 02:32

    If you want monitor file changes in camel, use file-watch component.

    Example -> RECURSIVE WATCH ALL EVENTS (FILE CREATION, FILE DELETION, FILE MODIFICATION):

    from("file-watch://some-directory")
    .log("File event: ${header.CamelFileEventType} occurred on file ${header.CamelFileName} at ${header.CamelFileLastModified}");
    

    You can see the complete documentation here: Camel file-watch component

提交回复
热议问题