You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/11/18 09:33:39 UTC

[camel] branch main updated (444da51 -> 9851614)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 444da51  CAMEL-16656: camel-core - ResourceReloader SPI - Allow to reload on changes
     new d1cd3b2  CAMEL-16656: camel-core - ResourceReloader SPI - Allow to reload on changes
     new 9851614  CAMEL-16656: camel-core - ResourceReloader SPI - Allow to reload on changes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../resources/META-INF/camel-main-configuration-metadata.json    | 2 +-
 core/camel-main/src/main/docs/main.adoc                          | 2 +-
 .../org/apache/camel/main/DefaultConfigurationProperties.java    | 5 ++---
 .../org/apache/camel/support/RouteWatcherReloadStrategy.java     | 9 ++++-----
 4 files changed, 8 insertions(+), 10 deletions(-)

[camel] 02/02: CAMEL-16656: camel-core - ResourceReloader SPI - Allow to reload on changes

Posted by da...@apache.org.
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 9851614e7e9b8a3486b80d3aae30bfc54b5ad377
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Nov 18 10:30:56 2021 +0100

    CAMEL-16656: camel-core - ResourceReloader SPI - Allow to reload on changes
---
 .../java/org/apache/camel/support/RouteWatcherReloadStrategy.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 d55cc33..baf633c 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
@@ -47,8 +47,8 @@ public class RouteWatcherReloadStrategy extends FileWatcherResourceReloadStrateg
     /**
      * Used for inclusive filtering of routes from directories.
      *
-     * Typical used for specifying to accept routes in XML or YAML files.
-     * Multiple patterns can be specified separated by comma.
+     * Typical used for specifying to accept routes in XML or YAML files. Multiple patterns can be specified separated
+     * by comma.
      */
     public void setPattern(String pattern) {
         this.pattern = pattern;

[camel] 01/02: CAMEL-16656: camel-core - ResourceReloader SPI - Allow to reload on changes

Posted by da...@apache.org.
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 d1cd3b2bfafe9a16ecb0d8048c9e71cf47b99755
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Nov 18 10:30:06 2021 +0100

    CAMEL-16656: camel-core - ResourceReloader SPI - Allow to reload on changes
---
 .../resources/META-INF/camel-main-configuration-metadata.json      | 2 +-
 core/camel-main/src/main/docs/main.adoc                            | 2 +-
 .../java/org/apache/camel/main/DefaultConfigurationProperties.java | 5 ++---
 .../java/org/apache/camel/support/RouteWatcherReloadStrategy.java  | 7 +++----
 4 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index fc2c494..659bfda 100644
--- a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -77,7 +77,7 @@
     { "name": "camel.main.routesIncludePattern", "description": "Used for inclusive filtering of routes from directories. The exclusive filtering takes precedence over inclusive filtering. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma, as example, to include all the routes from a directory whose name contains foo use: &#42;&#42;\/foo.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType":  [...]
     { "name": "camel.main.routesReloadDirectory", "description": "Directory to scan (incl subdirectories) for route changes. Camel cannot scan the classpath, so this must be configured to a file directory. Development with Maven as build tool, you can configure the directory to be src\/main\/resources to scan for Camel routes in XML or YAML files.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "src [...]
     { "name": "camel.main.routesReloadEnabled", "description": "Used for enabling automatic routes reloading. If enabled then Camel will watch for file changes in the given reload directory, and trigger reloading routes if files are changed.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
-    { "name": "camel.main.routesReloadPattern", "description": "Used for inclusive filtering of routes from directories. Typical used for specifying to accept routes in XML or YAML files. The default pattern is .yaml,.xml Multiple patterns can be specified separated by comma.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "*.xml,*.yaml" },
+    { "name": "camel.main.routesReloadPattern", "description": "Used for inclusive filtering of routes from directories. Typical used for specifying to accept routes in XML or YAML files. The default pattern is .yaml,.xml Multiple patterns can be specified separated by comma.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "camel\/*" },
     { "name": "camel.main.shutdownLogInflightExchangesOnTimeout", "description": "Sets whether to log information about the inflight Exchanges which are still running during a shutdown which didn't complete without the given timeout. This requires to enable the option inflightRepositoryBrowseEnabled.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
     { "name": "camel.main.shutdownNowOnTimeout", "description": "Sets whether to force shutdown of all consumers when a timeout occurred and thus not all consumers was shutdown within that period. You should have good reasons to set this option to false as it means that the routes keep running and is halted abruptly when CamelContext has been shutdown.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
     { "name": "camel.main.shutdownRoutesInReverseOrder", "description": "Sets whether routes should be shutdown in reverse or the same order as they were started.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
diff --git a/core/camel-main/src/main/docs/main.adoc b/core/camel-main/src/main/docs/main.adoc
index 47a0f8b..36edbd7 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -93,7 +93,7 @@ The camel.main supports 98 options, which are listed below.
 | *camel.main.routesInclude{zwsp}Pattern* | Used for inclusive filtering of routes from directories. The exclusive filtering takes precedence over inclusive filtering. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma, as example, to include all the routes from a directory whose name contains foo use: &#42;&#42;/foo. | classpath:camel/*,classpath:camel-template/*,classpath:camel-rest/* | String
 | *camel.main.routesReload{zwsp}Directory* | Directory to scan (incl subdirectories) for route changes. Camel cannot scan the classpath, so this must be configured to a file directory. Development with Maven as build tool, you can configure the directory to be src/main/resources to scan for Camel routes in XML or YAML files. | src/main/resources | String
 | *camel.main.routesReloadEnabled* | Used for enabling automatic routes reloading. If enabled then Camel will watch for file changes in the given reload directory, and trigger reloading routes if files are changed. | false | boolean
-| *camel.main.routesReloadPattern* | Used for inclusive filtering of routes from directories. Typical used for specifying to accept routes in XML or YAML files. The default pattern is .yaml,.xml Multiple patterns can be specified separated by comma. | *.xml,*.yaml | String
+| *camel.main.routesReloadPattern* | Used for inclusive filtering of routes from directories. Typical used for specifying to accept routes in XML or YAML files. The default pattern is .yaml,.xml Multiple patterns can be specified separated by comma. | camel/* | String
 | *camel.main.shutdownLogInflight{zwsp}ExchangesOnTimeout* | Sets whether to log information about the inflight Exchanges which are still running during a shutdown which didn't complete without the given timeout. This requires to enable the option inflightRepositoryBrowseEnabled. | true | boolean
 | *camel.main.shutdownNowOn{zwsp}Timeout* | Sets whether to force shutdown of all consumers when a timeout occurred and thus not all consumers was shutdown within that period. You should have good reasons to set this option to false as it means that the routes keep running and is halted abruptly when CamelContext has been shutdown. | true | boolean
 | *camel.main.shutdownRoutesIn{zwsp}ReverseOrder* | Sets whether routes should be shutdown in reverse or the same order as they were started. | true | boolean
diff --git a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
index 6fba9de..4d230b2 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
@@ -94,10 +94,10 @@ public abstract class DefaultConfigurationProperties<T> {
     private String routesIncludePattern = "classpath:camel/*,classpath:camel-template/*,classpath:camel-rest/*";
     private String routesExcludePattern;
     private boolean routesReloadEnabled;
-    @Metadata(defaultValue = "*.xml,*.yaml")
-    private String routesReloadPattern = "*.xml,*.yaml";
     @Metadata(defaultValue = "src/main/resources")
     private String routesReloadDirectory = "src/main/resources";
+    @Metadata(defaultValue = "camel/*")
+    private String routesReloadPattern = "camel/*";
     private boolean lightweight;
     private boolean eagerClassloading;
     @Metadata(defaultValue = "default", enums = "default,prototype,pooled")
@@ -991,7 +991,6 @@ public abstract class DefaultConfigurationProperties<T> {
      * Used for inclusive filtering of routes from directories.
      *
      * Typical used for specifying to accept routes in XML or YAML files. The default pattern is <tt>*.yaml,*.xml</tt>
-     *
      * Multiple patterns can be specified separated by comma.
      */
     public void setRoutesReloadPattern(String routesReloadPattern) {
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 f8a0748..d55cc33 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
@@ -31,7 +31,7 @@ import org.apache.camel.util.ObjectHelper;
  */
 public class RouteWatcherReloadStrategy extends FileWatcherResourceReloadStrategy {
 
-    private String pattern = "*.yaml,*.xml";
+    private String pattern = "camel/*";
 
     public RouteWatcherReloadStrategy() {
     }
@@ -47,8 +47,7 @@ public class RouteWatcherReloadStrategy extends FileWatcherResourceReloadStrateg
     /**
      * Used for inclusive filtering of routes from directories.
      *
-     * Typical used for specifying to accept routes in XML or YAML files. The default pattern is <tt>*.yaml,*.xml</tt>
-     *
+     * Typical used for specifying to accept routes in XML or YAML files.
      * Multiple patterns can be specified separated by comma.
      */
     public void setPattern(String pattern) {
@@ -67,7 +66,7 @@ public class RouteWatcherReloadStrategy extends FileWatcherResourceReloadStrateg
             final String[] parts = pattern.split(",");
             setFileFilter(f -> {
                 for (String part : parts) {
-                    // strip starting directory so we have a relative name to the starting folder
+                    // strip starting directory, so we have a relative name to the starting folder
                     String path = f.getAbsolutePath();
                     if (path.startsWith(base)) {
                         path = path.substring(base.length());