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 2022/03/19 14:15:22 UTC

[camel] 01/03: CAMEL-17815: camel-jbang - In modeline mode then eager discover routes and pre-load modeline to allow properties to be used during bootstrap.

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 2f976651ec8f43e2cc92c544e47d29d9287e189d
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Mar 19 08:32:05 2022 +0100

    CAMEL-17815: camel-jbang - In modeline mode then eager discover routes and pre-load modeline to allow properties to be used during bootstrap.
---
 .../src/main/java/org/apache/camel/main/BaseMainSupport.java          | 3 +--
 .../src/main/java/org/apache/camel/main/RoutesConfigurer.java         | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
index 27c0aa5..cf7cb55 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
@@ -680,8 +680,7 @@ public abstract class BaseMainSupport extends BaseService {
     }
 
     protected void autoConfigurationRoutesIncludePattern(
-            CamelContext camelContext, Map<String, String> autoConfiguredProperties)
-            throws Exception {
+            CamelContext camelContext, Map<String, String> autoConfiguredProperties) {
 
         Object pattern = getInitialProperties().getProperty("camel.main.routesIncludePattern");
         if (pattern != null) {
diff --git a/core/camel-main/src/main/java/org/apache/camel/main/RoutesConfigurer.java b/core/camel-main/src/main/java/org/apache/camel/main/RoutesConfigurer.java
index 9e979ef..e680485 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/RoutesConfigurer.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/RoutesConfigurer.java
@@ -251,8 +251,8 @@ public class RoutesConfigurer {
             try {
                 LOG.debug("RoutesCollectorEnabled: {}", getRoutesCollector());
 
-                // add discovered routes from directories
-                StopWatch watch = new StopWatch();
+                // we can only scan for modeline for routes that we can load from directory as modelines
+                // are comments in the source files
                 Collection<RoutesBuilder> routesFromDirectory = getRoutesCollector().collectRoutesFromDirectory(
                         camelContext,
                         getRoutesExcludePattern(),