davsclaus commented on code in PR #21216:
URL: https://github.com/apache/camel/pull/21216#discussion_r2754665184


##########
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:
   This will select the first port which ideally would be the non management 
server. But I wonder if we should also do a check if anyone are port 8080 as 
that is the default non management port, and we should favour using this if it 
was there.
   
   



-- 
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]

Reply via email to