This is an automated email from the ASF dual-hosted git repository. shoothzj pushed a commit to branch branch-4.17 in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
commit b075078df4418e9edc62150cc231be28b74f6069 Author: Lari Hotari <[email protected]> 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. (cherry picked from commit 15a38405bcd527cfcdd926ad356d0ea682a9a9be) --- .../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();
