This is an automated email from the ASF dual-hosted git repository. github-bot pushed a commit to branch camel-main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 1b3d093a41f14993200f7407ea53fbd94cc626b1 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 | 13 ++++++++++--- .../platform/http/runtime/PlatformHttpRecorder.java | 4 ++-- 2 files changed, 12 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..9f841ce4a2 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,10 +28,13 @@ 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; import org.apache.camel.quarkus.core.deployment.spi.CamelServiceFilterBuildItem; +import org.eclipse.microprofile.config.Config; +import org.eclipse.microprofile.config.ConfigProvider; class PlatformHttpProcessor { private static final String FEATURE = "camel-platform-http"; @@ -71,11 +74,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;