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
The following commit(s) were added to refs/heads/main by this push: new efbec21f630 CAMEL-20994: Fix a dead-lock in SB during starting when having camel-cli-connector enabled. efbec21f630 is described below commit efbec21f63068a21dc7d6762b93be85f98fea501 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Aug 8 11:50:54 2024 +0200 CAMEL-20994: Fix a dead-lock in SB during starting when having camel-cli-connector enabled. --- .../apache/camel/component/platform/http/PlatformHttpConsole.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpConsole.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpConsole.java index 5e8186c3981..898537976b2 100644 --- a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpConsole.java +++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpConsole.java @@ -36,7 +36,9 @@ public class PlatformHttpConsole extends AbstractDevConsole { protected String doCallText(Map<String, Object> options) { StringBuilder sb = new StringBuilder(); - PlatformHttpComponent http = getCamelContext().getComponent("platform-http", PlatformHttpComponent.class); + // do not auto-create as during bootstrap then this component in Spring Boot may + // currently be creating which can lead to a dead-lock in Spring Boot + PlatformHttpComponent http = (PlatformHttpComponent) getCamelContext().hasComponent("platform-http"); if (http != null) { String server = "http://0.0.0.0"; int port = http.getEngine().getServerPort(); @@ -60,7 +62,9 @@ public class PlatformHttpConsole extends AbstractDevConsole { protected JsonObject doCallJson(Map<String, Object> options) { JsonObject root = new JsonObject(); - PlatformHttpComponent http = getCamelContext().getComponent("platform-http", PlatformHttpComponent.class); + // do not auto-create as during bootstrap then this component in Spring Boot may + // currently be creating which can lead to a dead-lock in Spring Boot + PlatformHttpComponent http = (PlatformHttpComponent) getCamelContext().hasComponent("platform-http"); if (http != null) { String server = "http://0.0.0.0"; int port = http.getEngine().getServerPort();