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-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new f7bf5066c70 Camel Spring Boot auto configuration - removed code no 
longer in use, and deprecate wrong option for using run-controller.
f7bf5066c70 is described below

commit f7bf5066c700eb62dc7f801cc6012e7e9fdac131
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Jul 15 13:39:09 2025 +0200

    Camel Spring Boot auto configuration - removed code no longer in use, and 
deprecate wrong option for using run-controller.
---
 .../src/main/docs/spring-boot.json                 | 26 +++++++---
 .../boot/CamelSpringBootApplicationListener.java   |  4 +-
 core/camel-spring-boot/src/main/velocity/config.vm | 60 ++++++++--------------
 3 files changed, 40 insertions(+), 50 deletions(-)

diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.json 
b/core/camel-spring-boot/src/main/docs/spring-boot.json
index a281e73a572..fbc9d7e1b8f 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.json
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.json
@@ -907,13 +907,6 @@
       "description": "The global name to use for Log EIP The name is default 
the routeId or the source:line if source location is enabled. You can also 
specify the name using tokens: <br\/> ${class} - the logger class name 
(org.apache.camel.processor.LogProcessor) <br\/> ${contextId} - the camel 
context id <br\/> ${routeId} - the route id <br\/> ${groupId} - the route group 
id <br\/> ${nodeId} - the node id <br\/> ${nodePrefixId} - the node prefix id 
<br\/> ${source} - the source:line (s [...]
       "sourceType": 
"org.apache.camel.spring.boot.CamelConfigurationProperties$Main"
     },
-    {
-      "name": "camel.main.main-run-controller",
-      "type": "java.lang.Boolean",
-      "description": "Whether to use the main run controller to ensure the 
Spring-Boot application keeps running until being stopped or the JVM 
terminated. You typically only need this if you run Spring-Boot standalone. If 
you run Spring-Boot with spring-boot-starter-web then the web container keeps 
the JVM running.",
-      "sourceType": 
"org.apache.camel.spring.boot.CamelConfigurationProperties$Main",
-      "defaultValue": false
-    },
     {
       "name": "camel.main.mdc-logging-keys-pattern",
       "type": "java.lang.String",
@@ -1027,6 +1020,13 @@
       "sourceType": 
"org.apache.camel.spring.boot.CamelConfigurationProperties$Main",
       "defaultValue": false
     },
+    {
+      "name": "camel.main.run-controller",
+      "type": "java.lang.Boolean",
+      "description": "Whether to use the main run controller to ensure the 
Spring-Boot application keeps running until being stopped or the JVM 
terminated. You typically only need this if you run Spring-Boot standalone. If 
you run Spring-Boot with spring-boot-starter-web then the web container keeps 
the JVM running.",
+      "sourceType": 
"org.apache.camel.spring.boot.CamelConfigurationProperties$Main",
+      "defaultValue": false
+    },
     {
       "name": "camel.main.shutdown-log-inflight-exchanges-on-timeout",
       "type": "java.lang.Boolean",
@@ -2069,6 +2069,18 @@
       "description": "Whether to enable Camel info.",
       "defaultValue": true
     },
+    {
+      "name": "camel.main.main-run-controller",
+      "type": "java.lang.Boolean",
+      "description": "Whether to use the main run controller to ensure the 
Spring-Boot application keeps running until being stopped or the JVM 
terminated. You typically only need this if you run Spring-Boot standalone. If 
you run Spring-Boot with spring-boot-starter-web then the web container keeps 
the JVM running.",
+      "sourceType": 
"org.apache.camel.spring.boot.CamelConfigurationProperties$Main",
+      "defaultValue": false,
+      "deprecated": true,
+      "deprecation": {
+        "replacement": "camel.main.run-controller",
+        "since": "4.14.0"
+      }
+    },
     {
       "name": "management.endpoint.camel.enabled",
       "type": "java.lang.Boolean",
diff --git 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
index 549dfcc379b..3ea9b9bb670 100644
--- 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
+++ 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
@@ -25,8 +25,6 @@ import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
-import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.StartupListener;
 import org.apache.camel.main.MainDurationEventNotifier;
 import org.apache.camel.main.MainShutdownStrategy;
@@ -111,7 +109,7 @@ public class CamelSpringBootApplicationListener implements 
ApplicationListener<C
                     
camelContextConfiguration.beforeApplicationStart(camelContext);
                 }
 
-                if (configurationProperties.getMain().isMainRunController()) {
+                if (configurationProperties.getMain().isRunController() || 
configurationProperties.getMain().isMainRunController()) {
                     CamelMainRunController controller = new 
CamelMainRunController(applicationContext, camelContext);
 
                     if 
(configurationProperties.getMain().getDurationMaxMessages() > 0
diff --git a/core/camel-spring-boot/src/main/velocity/config.vm 
b/core/camel-spring-boot/src/main/velocity/config.vm
index 12ccf23096a..a74a488a941 100644
--- a/core/camel-spring-boot/src/main/velocity/config.vm
+++ b/core/camel-spring-boot/src/main/velocity/config.vm
@@ -30,28 +30,6 @@ import java.util.Map;
 @ConfigurationProperties(prefix = "camel")
 public class CamelConfigurationProperties  {
 
-    //
-    // Notes: the configuration is split into two classes,
-    // the springboot one and the main one.  The springboot classes,
-    // for historical reasons, duplicates all properties from the camel-main
-    // configuration.  Those {@code camel.springboot.*} properties have
-    // been deprecated in 4.5.0 in favor of {@code camel.main.*} properties.
-    //
-    // When the migration window is closed, the Springboot class can
-    // stop extending the InnerDeprecatedCamelConfigurationProperties class
-    // and that one removed.
-    //
-    // Note that due to the fact that camel-main properties are not set up
-    // as native spring properties, and the fact that the spring annotation
-    // processor which generates the documentation, only reads javadoc on the
-    // fields, the InnerCamelConfigurationProperties needs to duplicate all the
-    // fields from the DefaultConfigurationProperties.
-    //
-    // So both InnerCamelConfigurationProperties and 
InnerDeprecatedCamelConfigurationProperties
-    // classes contains redefinitions of properties from camel-main, hence
-    // the need to generate this whole file using a velocity template.
-    //
-
     @NestedConfigurationProperty
     private final Main main = new Main();
 
@@ -67,6 +45,15 @@ public class CamelConfigurationProperties  {
          * You typically only need this if you run Spring-Boot standalone.
          * If you run Spring-Boot with spring-boot-starter-web then the web 
container keeps the JVM running.
          */
+        private boolean runController;
+
+        /**
+         * Whether to use the main run controller to ensure the Spring-Boot 
application
+         * keeps running until being stopped or the JVM terminated.
+         * You typically only need this if you run Spring-Boot standalone.
+         * If you run Spring-Boot with spring-boot-starter-web then the web 
container keeps the JVM running.
+         */
+        @Deprecated
         private boolean mainRunController;
 
         /**
@@ -81,10 +68,21 @@ public class CamelConfigurationProperties  {
          */
         private boolean warnOnEarlyShutdown = true;
 
+        public boolean isRunController() {
+            return runController;
+        }
+
+        public void setRunController(boolean runController) {
+            this.runController = runController;
+        }
+
+        @DeprecatedConfigurationProperty(replacement = 
"camel.main.run-controller", since = "4.14.0")
+        @Deprecated
         public boolean isMainRunController() {
             return mainRunController;
         }
 
+        @Deprecated
         public void setMainRunController(boolean mainRunController) {
             this.mainRunController = mainRunController;
         }
@@ -107,24 +105,6 @@ public class CamelConfigurationProperties  {
 
     }
 
-    class InnerDeprecatedCamelConfigurationProperties extends 
InnerCamelConfigurationProperties {
-
-#foreach( $opt in $options )
-        @DeprecatedConfigurationProperty(replacement = 
"camel.main.${opt.propName}", since = "4.5.0")
-        @Deprecated
-        @Override
-        public ${opt.javaType} ${opt.getterName}() {
-            return main.${opt.getterName}();
-        }
-        @Deprecated
-        @Override
-        public void ${opt.setterName}(${opt.javaType} ${opt.fieldName}) {
-            main.${opt.setterName}(${opt.fieldName});
-        }
-
-#end
-    }
-
     @SuppressWarnings("all")
     static class InnerCamelConfigurationProperties extends 
DefaultConfigurationProperties {
 

Reply via email to