You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2020/08/18 06:00:19 UTC

[camel-quarkus] branch master updated (6f7f29b -> e6a93fd)

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

lburgazzoli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git.


    from 6f7f29b  Avoid purging artifacts for builds that may be in progress
     new ea33d45  Upgarde to camel v3.4.3
     new e6a93fd  Upgarde to camel v3.4.3 (fix MainShutdownStrategy)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/camel/quarkus/main/CamelMain.java   | 53 ++--------------------
 pom.xml                                            |  3 +-
 2 files changed, 6 insertions(+), 50 deletions(-)


[camel-quarkus] 02/02: Upgarde to camel v3.4.3 (fix MainShutdownStrategy)

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e6a93fd88c94096fa447b18e33f90d88a07342a5
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed Aug 12 13:30:41 2020 +0200

    Upgarde to camel v3.4.3 (fix MainShutdownStrategy)
---
 .../org/apache/camel/quarkus/main/CamelMain.java   | 53 ++--------------------
 1 file changed, 5 insertions(+), 48 deletions(-)

diff --git a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
index 7e71a52..ab75ad5 100644
--- a/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
+++ b/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
@@ -18,8 +18,6 @@ package org.apache.camel.quarkus.main;
 
 import java.util.Collection;
 import java.util.Collections;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import io.quarkus.runtime.Quarkus;
@@ -31,6 +29,7 @@ import org.apache.camel.main.MainCommandLineSupport;
 import org.apache.camel.main.MainConfigurationProperties;
 import org.apache.camel.main.MainListener;
 import org.apache.camel.main.MainShutdownStrategy;
+import org.apache.camel.main.SimpleMainShutdownStrategy;
 import org.apache.camel.spi.CamelBeanPostProcessor;
 import org.apache.camel.spi.HasCamelContext;
 import org.apache.camel.support.service.ServiceHelper;
@@ -59,7 +58,10 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC
 
     @Override
     protected void doInit() throws Exception {
-        setShutdownStrategy(new ShutdownStrategy());
+        MainShutdownStrategy shutdownStrategy = new SimpleMainShutdownStrategy();
+        shutdownStrategy.addShutdownListener(() -> Quarkus.asyncExit(getExitCode()));
+
+        setShutdownStrategy(shutdownStrategy);
 
         super.doInit();
         initCamelContext();
@@ -148,49 +150,4 @@ public final class CamelMain extends MainCommandLineSupport implements HasCamelC
         parseArguments(args);
         runEngine();
     }
-
-    /**
-     * Implementation of a {@link MainShutdownStrategy} based on Quarkus Command Mode.
-     *
-     * @see <a href="https://quarkus.io/guides/command-mode-reference">Quarkus Command Mode Applications</a>
-     */
-    private class ShutdownStrategy implements MainShutdownStrategy {
-        private final AtomicBoolean completed;
-        private final CountDownLatch latch;
-
-        public ShutdownStrategy() {
-            this.completed = new AtomicBoolean(false);
-            this.latch = new CountDownLatch(1);
-        }
-
-        @Override
-        public boolean isRunAllowed() {
-            return !completed.get();
-        }
-
-        @Override
-        public boolean shutdown() {
-            if (completed.compareAndSet(false, true)) {
-                latch.countDown();
-                Quarkus.asyncExit(getExitCode());
-                return true;
-            }
-
-            return false;
-        }
-
-        @Override
-        public void await() throws InterruptedException {
-            latch.await();
-        }
-
-        @Override
-        public void await(long timeout, TimeUnit unit) throws InterruptedException {
-            if (!latch.await(timeout, unit)) {
-                LOGGER.warn(
-                        "Could not await stopping CamelMain within {} {}. You may want to increase camel.main.shutdown.timeout",
-                        timeout, unit);
-            }
-        }
-    }
 }


[camel-quarkus] 01/02: Upgarde to camel v3.4.3

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ea33d45e98c8d499bbbc6856cd73dbfc1c4357ab
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed Aug 12 12:34:17 2020 +0200

    Upgarde to camel v3.4.3
---
 pom.xml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3634157..549b9a6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,7 +46,7 @@
         <awssdk1.version>1.11.714</awssdk1.version>
         <awssdk1-swf-libs.version>1.11.22</awssdk1-swf-libs.version>
         <awssdk2.version>2.13.33</awssdk2.version>
-        <camel.version>3.4.2</camel.version>
+        <camel.version>3.4.3</camel.version>
         <debezium.version>1.2.0.Final</debezium.version>
         <freemarker.version>2.3.30</freemarker.version>
         <github-api.version>1.111</github-api.version>
@@ -961,4 +961,3 @@
     </profiles>
 
 </project>
-