You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/05/15 18:49:03 UTC
[camel] branch camel-3.x updated: CAMEL-19357: camel-jbang - Avoid blocking vertx event handler thread which can lead to WARN logs
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.x by this push:
new 9bccb2d97c7 CAMEL-19357: camel-jbang - Avoid blocking vertx event handler thread which can lead to WARN logs
9bccb2d97c7 is described below
commit 9bccb2d97c7de3b69946a906a2b001d79f6c9e76
Author: Claus Ibsen <cl...@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 5fd2a018adb..87033fa3859 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);
}