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 343db7966e9 CAMEL-18089: camel-spring-boot - 
IllegalThreadStateException when trying to resume suspended Camel context
343db7966e9 is described below

commit 343db7966e94b5096aef3e08485fbb3af81f6c92
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed May 11 15:04:04 2022 +0200

    CAMEL-18089: camel-spring-boot - IllegalThreadStateException when trying to 
resume suspended Camel context
---
 .../java/org/apache/camel/spring/boot/CamelMainRunController.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelMainRunController.java
 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelMainRunController.java
index bbae692e192..0d3096b2875 100644
--- 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelMainRunController.java
+++ 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelMainRunController.java
@@ -16,9 +16,6 @@
  */
 package org.apache.camel.spring.boot;
 
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import org.apache.camel.CamelContext;
 import org.apache.camel.main.MainShutdownStrategy;
 import org.springframework.context.ApplicationContext;
@@ -37,7 +34,10 @@ public class CamelMainRunController {
     }
 
     public void start() {
-        daemon.start();
+        // avoid starting twice such as suspending and resuming a camel context
+        if (!daemon.isAlive()) {
+            daemon.start();
+        }
     }
 
     public MainShutdownStrategy getMainShutdownStrategy() {

Reply via email to