Created
May 11, 2017 11:13
-
-
Save mgyongyosi/0d4c89b0dc405673af0680dd7f6d5758 to your computer and use it in GitHub Desktop.
Apache Camel stop route when all file processed from the folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from("file:{{csv.import.directory}}?sendEmptyMessageWhenIdle=true&include=.*.csv").routeId("route1") | |
.autoStartup(false) | |
.choice() | |
.when(body().isEqualTo(null)) | |
.log("Stopping route") | |
.to("controlbus:route?async=true&routeId=route1&action=stop") | |
.otherwise() | |
.log("File with the following name processed: ${header.CamelFileName}") | |
.end() | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment