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 b4e210539c2 CAMEL-19357: camel-jbang - Avoid blocking vertx event 
handler thread which can lead to WARN logs
b4e210539c2 is described below

commit b4e210539c2db618a22448505530bb4dd4522b04
Author: Claus Ibsen <claus.ib...@gmail.com>
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 e53e7520f60..82aa1da5a16 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, 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, 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