This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 711d0387e87733e468690461b56b6b2431a10042 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Mon Apr 18 13:03:45 2022 +0200 Polished --- .../camel/support/FileWatcherResourceReloadStrategy.java | 11 +++++++++-- .../org/apache/camel/support/RouteWatcherReloadStrategy.java | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/camel-support/src/main/java/org/apache/camel/support/FileWatcherResourceReloadStrategy.java b/core/camel-support/src/main/java/org/apache/camel/support/FileWatcherResourceReloadStrategy.java index c45b8cadaf1..1e62cd72720 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/FileWatcherResourceReloadStrategy.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/FileWatcherResourceReloadStrategy.java @@ -140,7 +140,10 @@ public class FileWatcherResourceReloadStrategy extends ResourceReloadStrategySup File dir = new File(folder); if (dir.exists() && dir.isDirectory()) { - LOG.info("Starting ReloadStrategy to watch directory: {}", dir); + String msg = startupMessage(dir); + if (msg != null) { + LOG.info(msg); + } WatchEvent.Modifier modifier = null; @@ -160,7 +163,7 @@ public class FileWatcherResourceReloadStrategy extends ResourceReloadStrategySup } } if (modifier != null) { - LOG.info( + LOG.debug( "On Mac OS X the JDK WatchService is slow by default so enabling SensitivityWatchEventModifier.HIGH as workaround"); } else { LOG.warn( @@ -190,6 +193,10 @@ public class FileWatcherResourceReloadStrategy extends ResourceReloadStrategySup } } + protected String startupMessage(File dir) { + return "Starting ReloadStrategy to watch directory: " + dir; + } + private WatchKey registerPathToWatcher(WatchEvent.Modifier modifier, Path path, WatchService watcher) throws IOException { WatchKey key; if (modifier != null) { diff --git a/core/camel-support/src/main/java/org/apache/camel/support/RouteWatcherReloadStrategy.java b/core/camel-support/src/main/java/org/apache/camel/support/RouteWatcherReloadStrategy.java index d806ff3c16a..0570defbef4 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/RouteWatcherReloadStrategy.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/RouteWatcherReloadStrategy.java @@ -150,6 +150,11 @@ public class RouteWatcherReloadStrategy extends FileWatcherResourceReloadStrateg super.doStart(); } + @Override + protected String startupMessage(File dir) { + return "Live route reloading enabled (directory: " + dir + ")"; + } + protected void onPropertiesReload(Resource resource) { LOG.info("Reloading properties: {}. (Only Camel routes can be updated with changes)", resource.getLocation());