diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java index ef861524db72e..0380a2925edc2 100644 --- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java +++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java @@ -312,9 +312,8 @@ ServiceStartBuildItem finalizeRouter( defaultRoute.map(DefaultRouteBuildItem::getRoute).orElse(null), listOfFilters, vertx.getVertx(), lrc, mainRouter, httpRouteRouter.getHttpRouter(), httpRouteRouter.getMutinyRouter(), httpRouteRouter.getFrameworkRouter(), - nonApplicationRootPathBuildItem.isDedicatedRouterRequired(), - nonApplicationRootPathBuildItem.isAttachedToMainRouter(), httpRootPathBuildItem.getRootPath(), + nonApplicationRootPathBuildItem.getNonApplicationRootPath(), launchMode.getLaunchMode(), !requireBodyHandlerBuildItems.isEmpty(), bodyHandler, gracefulShutdownFilter, shutdownConfig, executorBuildItem.getExecutorProxy()); diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java index fb2249f033525..b596cee278fb3 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java @@ -341,8 +341,8 @@ public void finalizeRouter(BeanContainer container, Consumer defaultRoute LiveReloadConfig liveReloadConfig, Optional> mainRouterRuntimeValue, RuntimeValue httpRouterRuntimeValue, RuntimeValue mutinyRouter, RuntimeValue frameworkRouter, - boolean nonApplicationDedicatedRouter, boolean nonApplicationAttachedToMainRouter, - String rootPath, LaunchMode launchMode, boolean requireBodyHandler, + String rootPath, String nonRootPath, + LaunchMode launchMode, boolean requireBodyHandler, Handler bodyHandler, GracefulShutdownFilter gracefulShutdownFilter, ShutdownConfig shutdownConfig, Executor executor) { @@ -560,10 +560,17 @@ public void handle(HttpServerRequest event) { } AccessLogHandler handler = new AccessLogHandler(receiver, accessLog.pattern, getClass().getClassLoader(), accessLog.excludePattern); - if (nonApplicationDedicatedRouter && !nonApplicationAttachedToMainRouter) { + if (rootPath.equals("/") || nonRootPath.equals("/")) { + mainRouterRuntimeValue.orElse(httpRouterRuntimeValue).getValue().route().order(Integer.MIN_VALUE) + .handler(handler); + } else if (nonRootPath.startsWith(rootPath)) { + httpRouteRouter.route().order(Integer.MIN_VALUE).handler(handler); + } else if (rootPath.startsWith(nonRootPath)) { + frameworkRouter.getValue().route().order(Integer.MIN_VALUE).handler(handler); + } else { + httpRouteRouter.route().order(Integer.MIN_VALUE).handler(handler); frameworkRouter.getValue().route().order(Integer.MIN_VALUE).handler(handler); } - httpRouteRouter.route().order(Integer.MIN_VALUE).handler(handler); quarkusWrapperNeeded = true; }