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-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new 4ed30ef  CAMEL-16656: camel-core - ResourceReloader SPI - Allow to 
reload on changes
4ed30ef is described below

commit 4ed30efe81681eb1f723d35eebe0b26a2f00a86c
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Nov 19 10:58:45 2021 +0100

    CAMEL-16656: camel-core - ResourceReloader SPI - Allow to reload on changes
---
 .../main-yaml/src/main/java/org/apache/camel/example/MyApplication.java | 1 +
 examples/main-yaml/src/main/resources/application.properties            | 2 ++
 2 files changed, 3 insertions(+)

diff --git 
a/examples/main-yaml/src/main/java/org/apache/camel/example/MyApplication.java 
b/examples/main-yaml/src/main/java/org/apache/camel/example/MyApplication.java
index 04d2b8a..c49cba3 100644
--- 
a/examples/main-yaml/src/main/java/org/apache/camel/example/MyApplication.java
+++ 
b/examples/main-yaml/src/main/java/org/apache/camel/example/MyApplication.java
@@ -38,6 +38,7 @@ public final class MyApplication {
         main.configure().withRoutesReloadEnabled(true);
         main.configure().withRoutesReloadDirectory("src/main/resources");
         main.configure().withRoutesReloadPattern("routes/*.yaml");
+        main.configure().withRoutesReloadRemoveAllRoutes(true);
 
         // now keep the application running until the JVM is terminated (ctrl 
+ c or sigterm)
         main.run(args);
diff --git a/examples/main-yaml/src/main/resources/application.properties 
b/examples/main-yaml/src/main/resources/application.properties
index f8a38f8..b654e10 100644
--- a/examples/main-yaml/src/main/resources/application.properties
+++ b/examples/main-yaml/src/main/resources/application.properties
@@ -25,6 +25,8 @@ camel.main.routes-reload-enabled = true
 camel.main.routes-reload-directory = src/main/resources
 # pattern(s) for files to watch
 camel.main.routes-reload-pattern = routes/*.yaml
+# on reload should all existing routes be removed first
+camel.main.routes-reload-remove-all-routes = true
 
 # to configure the camel quartz component
 # here we can configure the options on the component level (and we can use 
dash-naming-style)

Reply via email to