You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zh...@apache.org on 2022/06/30 03:06:10 UTC

[camel-quarkus] branch main updated: Fix #3858 rename to quarkus.camel.source-location-enabled (#3886)

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

zhfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new fa14018903 Fix #3858 rename to quarkus.camel.source-location-enabled (#3886)
fa14018903 is described below

commit fa140189032562b31def771eeacc75c8f484e1b9
Author: Amos Feng <zh...@gmail.com>
AuthorDate: Thu Jun 30 11:06:06 2022 +0800

    Fix #3858 rename to quarkus.camel.source-location-enabled (#3886)
---
 docs/modules/ROOT/pages/reference/extensions/core.adoc              | 6 ++++++
 .../apache/camel/quarkus/core/deployment/CamelContextProcessor.java | 6 ++++--
 .../camel/quarkus/core/deployment/CamelSourceLocationTest.java      | 2 +-
 .../src/main/java/org/apache/camel/quarkus/core/CamelConfig.java    | 6 ++++++
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/docs/modules/ROOT/pages/reference/extensions/core.adoc b/docs/modules/ROOT/pages/reference/extensions/core.adoc
index 436f8d4c1c..1a92ce4cac 100644
--- a/docs/modules/ROOT/pages/reference/extensions/core.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/core.adoc
@@ -254,6 +254,12 @@ Whether to enable the bridging of Camel events to CDI events.
 | `boolean`
 | `true`
 
+|icon:lock[title=Fixed at build time] [[quarkus.camel.source-location-enabled]]`link:#quarkus.camel.source-location-enabled[quarkus.camel.source-location-enabled]`
+
+Build time configuration options for enable/disable camel source location
+| `boolean`
+| `false`
+
 |icon:lock[title=Fixed at build time] [[quarkus.camel.main.shutdown.timeout]]`link:#quarkus.camel.main.shutdown.timeout[quarkus.camel.main.shutdown.timeout]`
 
 A timeout (with millisecond precision) to wait for `CamelMain++#++stop()` to finish
diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextProcessor.java
index 674b4c8275..9bcfc024c8 100644
--- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextProcessor.java
+++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextProcessor.java
@@ -112,7 +112,7 @@ public class CamelContextProcessor {
     }
 
     /**
-     * Enable source location if camel.quarkus.source-location-enabled=true
+     * Enable source location if quarkus.camel.source-location-enabled=true
      *
      * @param recorder the recorder
      * @param producer producer of context customizer build item
@@ -177,9 +177,11 @@ public class CamelContextProcessor {
     }
 
     public static final class SourceLocationEnabled implements BooleanSupplier {
+        CamelConfig config;
+
         @Override
         public boolean getAsBoolean() {
-            return CamelSupport.getOptionalConfigValue("camel.quarkus.source-location-enabled", Boolean.class, false);
+            return config.sourceLocationEnabled;
         }
     }
 }
diff --git a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/CamelSourceLocationTest.java b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/CamelSourceLocationTest.java
index a643be9f10..6dafc2d327 100644
--- a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/CamelSourceLocationTest.java
+++ b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/CamelSourceLocationTest.java
@@ -49,7 +49,7 @@ public class CamelSourceLocationTest {
         Writer writer = new StringWriter();
 
         Properties props = new Properties();
-        props.setProperty("camel.quarkus.source-location-enabled", "true");
+        props.setProperty("quarkus.camel.source-location-enabled", "true");
 
         try {
             props.store(writer, "");
diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java
index 0249167f5d..9c62934b18 100644
--- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java
+++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java
@@ -72,6 +72,12 @@ public class CamelConfig {
     @ConfigItem
     public EventBridgeConfig eventBridge;
 
+    /**
+     * Build time configuration options for enable/disable camel source location
+     */
+    @ConfigItem(defaultValue = "false")
+    public boolean sourceLocationEnabled;
+
     @ConfigGroup
     public static class BootstrapConfig {
         /**