gnodet-bot commented on code in PR #31225:
URL: https://github.com/apache/camel/pull/31225#discussion_r4765117980


##########
components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServer.java:
##########
@@ -221,11 +226,20 @@ protected void doStart() throws Exception {
         String routerName = 
VertxPlatformHttpRouter.getRouterNameFromPort(getPort());
         router = VertxPlatformHttpRouter.lookup(camelContext, routerName);
         platformHttpComponent = camelContext.getComponent("platform-http", 
PlatformHttpComponent.class);
+        // tell the dev console where the endpoints are served
+        platformHttpComponent.setServerUrl(server.getScheme() + "://0.0.0.0:" 
+ server.getPort());
 
         setupConsoles();
         setupStartupSummary();
     }
 
+    @Override
+    protected void doStop() throws Exception {
+        if (platformHttpComponent != null) {
+            platformHttpComponent.setServerUrl(null);
+        }
+    }

Review Comment:
   ⚠️ **Missing `super.doStop()` call:** `BaseService.doStop()` is a no-op 
today, so this is harmless — but defensively chaining the call is cheap 
insurance against future parent-class additions.
   
   ```suggestion
       @Override
       protected void doStop() throws Exception {
           if (platformHttpComponent != null) {
               platformHttpComponent.setServerUrl(null);
           }
           super.doStop();
       }
   ```



##########
components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/ManagementHttpServer.java:
##########
@@ -493,11 +493,20 @@ protected void doStart() throws Exception {
         String routerName = 
VertxPlatformHttpRouter.getRouterNameFromPort(getPort());
         router = VertxPlatformHttpRouter.lookup(camelContext, routerName);
         platformHttpComponent = camelContext.getComponent("platform-http", 
PlatformHttpComponent.class);
+        // tell the dev console where the endpoints are served
+        platformHttpComponent.setManagementServerUrl(server.getScheme() + 
"://0.0.0.0:" + server.getPort());
 
         setupConsoles();
         setupStartupSummary();
     }
 
+    @Override
+    protected void doStop() throws Exception {
+        if (platformHttpComponent != null) {
+            platformHttpComponent.setManagementServerUrl(null);
+        }
+    }

Review Comment:
   Same as `MainHttpServer.doStop()`: `super.doStop()` should be called for 
defensive correctness.
   
   ```suggestion
       @Override
       protected void doStop() throws Exception {
           if (platformHttpComponent != null) {
               platformHttpComponent.setManagementServerUrl(null);
           }
           super.doStop();
       }
   ```



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