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

davsclaus pushed a commit to branch camel-3.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.20.x by this push:
     new 96dc2cdb2c4 CAMEL-19357: camel-jbang - Avoid blocking vertx event 
handler thread which can lead to WARN logs
96dc2cdb2c4 is described below

commit 96dc2cdb2c44d2ae57fbbf0d081b3433e8c5d671
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon May 15 20:48:34 2023 +0200

    CAMEL-19357: camel-jbang - Avoid blocking vertx event handler thread which 
can lead to WARN logs
---
 .../org/apache/camel/main/http/VertxHttpServer.java    | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git 
a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/http/VertxHttpServer.java
 
b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/http/VertxHttpServer.java
index 213329d7074..ba53d5a6849 100644
--- 
a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/http/VertxHttpServer.java
+++ 
b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/http/VertxHttpServer.java
@@ -38,6 +38,7 @@ import io.vertx.ext.web.RequestBody;
 import io.vertx.ext.web.Route;
 import io.vertx.ext.web.RoutingContext;
 import io.vertx.ext.web.handler.BodyHandler;
+import io.vertx.ext.web.impl.BlockingHandlerDecorator;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.RuntimeCamelException;
@@ -295,8 +296,9 @@ public final class VertxHttpServer {
                 }
             }
         };
-        dev.handler(handler);
-        devSub.handler(handler);
+        // use blocking handler as the task can take longer time to complete
+        dev.handler(new BlockingHandlerDecorator(handler, true));
+        devSub.handler(new BlockingHandlerDecorator(handler, true));
 
         phc.addHttpEndpoint("/q/dev", null);
     }
@@ -370,9 +372,10 @@ public final class VertxHttpServer {
                 ctx.end(sb.toString());
             }
         };
-        health.handler(handler);
-        live.handler(handler);
-        ready.handler(handler);
+        // use blocking handler as the task can take longer time to complete
+        health.handler(new BlockingHandlerDecorator(handler, true));
+        live.handler(new BlockingHandlerDecorator(handler, true));
+        ready.handler(new BlockingHandlerDecorator(handler, true));
 
         phc.addHttpEndpoint("/q/health", null);
     }
@@ -548,8 +551,9 @@ public final class VertxHttpServer {
                 ctx.end();
             }
         };
-        upload.handler(handler);
-        uploadDelete.handler(handler);
+        // use blocking handler as the task can take longer time to complete
+        upload.handler(new BlockingHandlerDecorator(handler, true));
+        uploadDelete.handler(new BlockingHandlerDecorator(handler, true));
 
         phc.addHttpEndpoint("/q/upload", "PUT,DELETE", null);
     }

Reply via email to