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

Croway pushed a commit to branch camel-spring-boot-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit 36af212ffbee9753b1d57fc4b38a199ed92fbb26
Author: Croway <[email protected]>
AuthorDate: Mon May 4 17:02:18 2026 +0200

    chore: fix platform-http failures with Spring Boot 3.5.14
---
 .../springboot/PlatformHttpComponentAutoConfiguration.java  |  9 +++++----
 .../springboot/SpringBootPlatformHttpAutoConfiguration.java |  6 +++---
 .../http/springboot/SpringBootPlatformHttpConsumer.java     | 13 ++++++-------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/PlatformHttpComponentAutoConfiguration.java
 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/PlatformHttpComponentAutoConfiguration.java
index 36fc0bcb4db..f007401dea6 100644
--- 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/PlatformHttpComponentAutoConfiguration.java
+++ 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/PlatformHttpComponentAutoConfiguration.java
@@ -33,6 +33,7 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.context.annotation.Lazy;
 
 /**
@@ -47,13 +48,13 @@ public class PlatformHttpComponentAutoConfiguration {
 
     @Autowired
     private ApplicationContext applicationContext;
-    private final CamelContext camelContext;
+    private final ObjectProvider<CamelContext> camelContextProvider;
     @Autowired
     private PlatformHttpComponentConfiguration configuration;
 
     public PlatformHttpComponentAutoConfiguration(
-            org.apache.camel.CamelContext camelContext) {
-        this.camelContext = camelContext;
+            ObjectProvider<CamelContext> camelContextProvider) {
+        this.camelContextProvider = camelContextProvider;
     }
 
     @Lazy
@@ -62,7 +63,7 @@ public class PlatformHttpComponentAutoConfiguration {
         return new ComponentCustomizer() {
             @Override
             public void configure(String name, Component target) {
-                CamelPropertiesHelper.copyProperties(camelContext, 
configuration, target);
+                
CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), 
configuration, target);
             }
             @Override
             public boolean isEnabled(String name, Component target) {
diff --git 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpAutoConfiguration.java
 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpAutoConfiguration.java
index a9fdbc9d056..8e60598d4a9 100644
--- 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpAutoConfiguration.java
+++ 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpAutoConfiguration.java
@@ -28,7 +28,7 @@ import 
org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties;
 import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.DependsOn;
+import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.core.env.Environment;
 import org.springframework.core.task.SimpleAsyncTaskExecutor;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@@ -96,8 +96,8 @@ public class SpringBootPlatformHttpAutoConfiguration {
     }
 
     @Bean
-    @DependsOn("configurePlatformHttpComponent")
-    public CamelRequestHandlerMapping 
platformHttpEngineRequestMapping(PlatformHttpEngine engine, CamelContext 
camelContext) {
+    public CamelRequestHandlerMapping 
platformHttpEngineRequestMapping(PlatformHttpEngine engine, 
ObjectProvider<CamelContext> camelContextProvider) {
+        CamelContext camelContext = camelContextProvider.getObject();
         PlatformHttpComponent component = 
camelContext.getComponent("platform-http", PlatformHttpComponent.class);
         CamelRequestHandlerMapping answer = new 
CamelRequestHandlerMapping(component, engine);
         return answer;
diff --git 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpConsumer.java
 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpConsumer.java
index 04f54ba829b..14325b4a5ba 100644
--- 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpConsumer.java
+++ 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpConsumer.java
@@ -16,7 +16,7 @@
  */
 package org.apache.camel.component.platform.http.springboot;
 
-import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Callable;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
 
@@ -84,13 +84,11 @@ public class SpringBootPlatformHttpConsumer extends 
DefaultConsumer implements P
     /**
      * This method is invoked by Spring Boot when invoking Camel via 
platform-http.
      *
-     * The method is already running asynchronously via 
AsyncExecutionInterceptor.
-     *
-     * Returns an empty CompletableFuture as per documentation 
https://spring.io/guides/gs/async-method
+     * Returns a Callable to integrate with Spring MVC async request lifecycle.
      */
     @ResponseBody
-    public CompletableFuture<Void> service(HttpServletRequest request, 
HttpServletResponse response) {
-        return CompletableFuture.runAsync(() -> {
+    public Callable<Void> service(HttpServletRequest request, 
HttpServletResponse response) {
+        return () -> {
             LOG.trace("Service: {}", request);
             try {
                 handleService(request, response);
@@ -105,7 +103,8 @@ public class SpringBootPlatformHttpConsumer extends 
DefaultConsumer implements P
                     // ignore
                 }
             }
-        }, executor);
+            return null;
+        };
     }
 
     protected void handleService(HttpServletRequest request, 
HttpServletResponse response) throws Exception {

Reply via email to