You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by sh...@apache.org on 2024/04/08 08:24:22 UTC
(bookkeeper) branch master updated: Use vertx blockingHandlers that allow blocking without warnings (#4266)
This is an automated email from the ASF dual-hosted git repository.
shoothzj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 15a38405bc Use vertx blockingHandlers that allow blocking without warnings (#4266)
15a38405bc is described below
commit 15a38405bcd527cfcdd926ad356d0ea682a9a9be
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Mon Apr 8 01:24:16 2024 -0700
Use vertx blockingHandlers that allow blocking without warnings (#4266)
### Motivation
- The http handler implementations in Bookkeeper aren't necessarily non-blocking. That's why they should be executed on the blocking thread pool in vertx.
### Changes
Executing on blocking thread pool in vertx can be achieved by registering the handlers using the `blockingHandler` method instead of the `handler` method.
---
.../java/org/apache/bookkeeper/http/vertx/VertxHttpServer.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/bookkeeper-http/vertx-http-server/src/main/java/org/apache/bookkeeper/http/vertx/VertxHttpServer.java b/bookkeeper-http/vertx-http-server/src/main/java/org/apache/bookkeeper/http/vertx/VertxHttpServer.java
index 331ed6566b..94bb83a03f 100644
--- a/bookkeeper-http/vertx-http-server/src/main/java/org/apache/bookkeeper/http/vertx/VertxHttpServer.java
+++ b/bookkeeper-http/vertx-http-server/src/main/java/org/apache/bookkeeper/http/vertx/VertxHttpServer.java
@@ -83,10 +83,10 @@ public class VertxHttpServer implements HttpServer {
HttpRouter<VertxAbstractHandler> requestRouter = new HttpRouter<VertxAbstractHandler>(handlerFactory) {
@Override
public void bindHandler(String endpoint, VertxAbstractHandler handler) {
- router.get(endpoint).handler(handler);
- router.put(endpoint).handler(handler);
- router.post(endpoint).handler(handler);
- router.delete(endpoint).handler(handler);
+ router.get(endpoint).blockingHandler(handler);
+ router.put(endpoint).blockingHandler(handler);
+ router.post(endpoint).blockingHandler(handler);
+ router.delete(endpoint).blockingHandler(handler);
}
};
requestRouter.bindAll();