ammachado opened a new pull request, #31225:
URL: https://github.com/apache/camel/pull/31225

   # Description
   
   Fixes [CAMEL-27997](https://issues.apache.org/jira/browse/CAMEL-27997), 
found while checking the console descriptions of CAMEL-27980.
   
   **1. `main-http-server` console (camel-platform-http-main)**
   The leading `/` of the context path was stripped, so path `/api` printed 
`http://0.0.0.0:8080api`. It now prints `http://0.0.0.0:8080/api`, and uses the 
scheme of the server instead of a literal `http`.
   
   **2. `platform-http` console (camel-platform-http)**
   Every URL was built from `http://0.0.0.0` and the port of the engine, so:
   - management endpoints showed the port of the HTTP server, also when the 
management server has its own port (`camel.management.port`);
   - TLS was never shown as `https`.
   
   The console lives in `camel-platform-http`, which does not know the servers 
of `camel-platform-http-main`, so the servers now tell the component:
   - `MainHttpServer` / `ManagementHttpServer` set `serverUrl` / 
`managementServerUrl` on `PlatformHttpComponent` when they start, and clear 
them when they stop. These are plain properties, not component options (nothing 
new in the component catalog). With a shared port, the management URL is the 
URL of the HTTP server.
   - `VertxPlatformHttpServer.getScheme()` (new) answers `https` by the same 
rule that sets up SSL on the server 
(`VertxPlatformHttpServerSupport.configureSSL`): its own 
`sslContextParameters`, or `useGlobalSslContextParameters` with global SSL 
context parameters present.
   - Without these values (Spring Boot, Quarkus), the console falls back to the 
scheme and port of the engine as before.
   - The JSON output has a new optional `managementServer` field; the `url` of 
each management endpoint is now on the right server. The Camel CLI (`camel get 
platform-http`, `camel status`) shows these `url` values, so it gets the fix 
without a change.
   
   **Tests**
   - `PlatformHttpDevConsoleUrlTest` (Camel Main with a route and management 
endpoints): management on its own port, management on the shared port, and the 
`/api` context path. All 3 fail on the previous console code.
   - `VertxPlatformHttpServerSchemeTest`: http without SSL, https with own or 
global SSL context parameters, http when global SSL is requested but not 
configured.
   
   **Not in this PR (possible follow-up):** the startup summary 
(`MainHttpServerUtil.setupStartupSummary`) decides `https` only from 
`useGlobalSslContextParameters`, so it prints `http` for a server with its own 
`sslContextParameters`. It could reuse `VertxPlatformHttpServer.getScheme()`.
   
   No upgrade guide entry: bug fix, and the JSON change only adds a field.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   
   Ran `mvn clean install -Dquickly` from the root; the regenerated dev console 
metadata (component and catalog) is committed. Tests of camel-platform-http, 
camel-platform-http-vertx and camel-platform-http-main pass.
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code) on behalf of 
Adriano Machado (@ammachado)
   
   _This was generated by an AI agent and may contain inaccuracies. Please 
verify before relying on it._


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