This is an automated email from the ASF dual-hosted git repository. jiriondrusek pushed a commit to branch camel-main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 604664adb8bcdc9c6c3e46cf392a04ea31c3976e Author: Pasquale Congiusti <pasquale.congiu...@gmail.com> AuthorDate: Fri Apr 25 11:49:07 2025 +0200 chore(platform-http): use default router name --- .../platform/http/deployment/PlatformHttpProcessor.java | 11 ++++++++--- .../component/platform/http/runtime/PlatformHttpRecorder.java | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java b/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java index 824deff048..fa36023c9a 100644 --- a/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java +++ b/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java @@ -28,6 +28,7 @@ import org.apache.camel.component.platform.http.PlatformHttpComponent; import org.apache.camel.component.platform.http.PlatformHttpConstants; import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpEngine; import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpRouter; +import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpServerConfiguration; import org.apache.camel.quarkus.component.platform.http.runtime.PlatformHttpRecorder; import org.apache.camel.quarkus.core.deployment.spi.CamelRuntimeBeanBuildItem; import org.apache.camel.quarkus.core.deployment.spi.CamelServiceFilter; @@ -71,11 +72,15 @@ class PlatformHttpProcessor { VertxWebRouterBuildItem router, BodyHandlerBuildItem bodyHandler, PlatformHttpRecorder recorder) { + // at build time we're safe using the default, as it's the value used to register the router + // regardless if the port changes at runtime + String routerName = VertxPlatformHttpRouter.getRouterNameFromPort( + VertxPlatformHttpServerConfiguration.DEFAULT_BIND_PORT); return new CamelRuntimeBeanBuildItem( - VertxPlatformHttpRouter.PLATFORM_HTTP_ROUTER_NAME, + routerName, Router.class.getName(), - recorder.createVertxPlatformHttpRouter(vertx.getVertx(), router.getHttpRouter(), bodyHandler.getHandler(), - VertxPlatformHttpRouter.PLATFORM_HTTP_ROUTER_NAME)); + recorder.createVertxPlatformHttpRouter( + vertx.getVertx(), router.getHttpRouter(), bodyHandler.getHandler(), routerName)); } @Record(ExecutionTime.RUNTIME_INIT) diff --git a/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java b/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java index c994ae5718..601724f83c 100644 --- a/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java +++ b/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java @@ -40,9 +40,9 @@ public class PlatformHttpRecorder { } public RuntimeValue<VertxPlatformHttpRouter> createVertxPlatformHttpRouter(RuntimeValue<Vertx> vertx, - RuntimeValue<Router> router, Handler<RoutingContext> handler, String name) { + RuntimeValue<Router> router, Handler<RoutingContext> handler, String routerName) { VertxPlatformHttpRouter vertxPlatformHttpRouter = new VertxPlatformHttpRouter(null, vertx.getValue(), - router.getValue(), name) { + router.getValue(), routerName) { @Override public Handler<RoutingContext> bodyHandler() { return handler;