oscerd commented on code in PR #21216:
URL: https://github.com/apache/camel/pull/21216#discussion_r2754674400
##########
components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngine.java:
##########
@@ -115,6 +116,21 @@ public int getServerPort() {
port = router.getServer().getServer().actualPort();
}
}
+ // When there are multiple servers (e.g., main server and
management server),
+ // findSingleByType returns null. In this case, look for any
available router
+ // registered in the registry and use its server port.
+ if (port == 0) {
+ Map<String, VertxPlatformHttpRouter> routers
+ =
camelContext.getRegistry().findByTypeWithName(VertxPlatformHttpRouter.class);
+ for (VertxPlatformHttpRouter router : routers.values()) {
+ if (router.getServer() != null &&
router.getServer().getServer() != null) {
+ port = router.getServer().getServer().actualPort();
Review Comment:
Converted to draft and I rework on this part.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]