You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/05/03 05:06:47 UTC

[camel] branch main updated (cf00d6f5159 -> 5d746928e97)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from cf00d6f5159 Regen for commit af5bbc8e2da0d92faa2e72d32e58cea823531fe3
     new 638aadf20e2 CAMEL-18026: camel-rest - Rest DSL - Output more fine grained http endpoints that are available
     new 5d746928e97 CAMEL-18026: dev console for camel-platform-http

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../http/vertx/VertxPlatformHttpEngine.java        | 42 ++++++++++++++-
 .../http/vertx/VertxPlatformHttpRouter.java        |  9 +++-
 .../http/vertx/VertxPlatformHttpServer.java        |  6 ++-
 .../http/vertx/VertxPlatformHttpEngineTest.java    |  7 +--
 components/camel-platform-http/pom.xml             |  5 ++
 .../org/apache/camel/dev-console/platform-http     |  2 +
 .../platform/http/HttpEndpointModel.java}          | 60 +++++++++++++---------
 .../platform/http/PlatformHttpComponent.java       | 22 +++++---
 .../platform/http/PlatformHttpConsole.java         | 35 +++++++------
 .../platform/http/PlatformHttpEndpoint.java        |  4 +-
 .../platform/http/spi/PlatformHttpEngine.java      |  5 ++
 .../http/JettyCustomPlatformHttpConsumer.java      |  1 -
 .../http/JettyCustomPlatformHttpEngine.java        | 17 ++++++
 .../component/platform/http/JettyServerTest.java   | 18 +++----
 .../component/platform/http/PlatformHttpTest.java  |  6 +--
 .../org/apache/camel/main/VertxHttpServer.java     | 18 ++++---
 16 files changed, 184 insertions(+), 73 deletions(-)
 create mode 100644 components/camel-platform-http/src/generated/resources/META-INF/services/org/apache/camel/dev-console/platform-http
 copy components/{camel-undertow/src/main/java/org/apache/camel/component/undertow/HttpHandlerRegistrationInfo.java => camel-platform-http/src/main/java/org/apache/camel/component/platform/http/HttpEndpointModel.java} (50%)
 copy core/camel-console/src/main/java/org/apache/camel/impl/console/PropertiesDevConsole.java => components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpConsole.java (52%)


[camel] 02/02: CAMEL-18026: dev console for camel-platform-http

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 5d746928e973fa0a3c7004532ac4da7851d35fd3
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue May 3 07:05:12 2022 +0200

    CAMEL-18026: dev console for camel-platform-http
---
 .../http/vertx/VertxPlatformHttpEngine.java        | 42 ++++++++++++++++-
 .../http/vertx/VertxPlatformHttpRouter.java        |  9 +++-
 .../http/vertx/VertxPlatformHttpServer.java        |  6 ++-
 .../http/vertx/VertxPlatformHttpEngineTest.java    |  7 +--
 components/camel-platform-http/pom.xml             |  5 ++
 .../org/apache/camel/dev-console/platform-http     |  2 +
 .../component/platform/http/HttpEndpointModel.java |  4 +-
 .../platform/http/PlatformHttpConsole.java         | 54 ++++++++++++++++++++++
 .../platform/http/spi/PlatformHttpEngine.java      |  5 ++
 .../http/JettyCustomPlatformHttpConsumer.java      |  1 -
 .../http/JettyCustomPlatformHttpEngine.java        | 17 +++++++
 .../component/platform/http/JettyServerTest.java   | 18 ++++----
 12 files changed, 152 insertions(+), 18 deletions(-)

diff --git a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngine.java b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngine.java
index 17c7246f811..325cd4d6507 100644
--- a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngine.java
+++ b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngine.java
@@ -22,25 +22,41 @@ import java.util.List;
 
 import io.vertx.core.Handler;
 import io.vertx.ext.web.RoutingContext;
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.component.platform.http.PlatformHttpConstants;
 import org.apache.camel.component.platform.http.PlatformHttpEndpoint;
 import org.apache.camel.component.platform.http.spi.PlatformHttpEngine;
 import org.apache.camel.spi.annotations.JdkService;
+import org.apache.camel.support.CamelContextHelper;
 import org.apache.camel.support.service.ServiceSupport;
 
 /**
  * Implementation of the {@link PlatformHttpEngine} based on Vert.x Web.
  */
 @JdkService(PlatformHttpConstants.PLATFORM_HTTP_ENGINE_FACTORY)
-public class VertxPlatformHttpEngine extends ServiceSupport implements PlatformHttpEngine {
+public class VertxPlatformHttpEngine extends ServiceSupport implements PlatformHttpEngine, CamelContextAware {
+
+    private CamelContext camelContext;
     private List<Handler<RoutingContext>> handlers;
+    private int port;
 
     public VertxPlatformHttpEngine() {
         this.handlers = Collections.emptyList();
     }
 
+    @Override
+    public CamelContext getCamelContext() {
+        return camelContext;
+    }
+
+    @Override
+    public void setCamelContext(CamelContext camelContext) {
+        this.camelContext = camelContext;
+    }
+
     public List<Handler<RoutingContext>> getHandlers() {
         return Collections.unmodifiableList(handlers);
     }
@@ -68,4 +84,28 @@ public class VertxPlatformHttpEngine extends ServiceSupport implements PlatformH
                 processor,
                 handlers);
     }
+
+    @Override
+    public int getServerPort() {
+        if (port == 0) {
+            VertxPlatformHttpServer server = CamelContextHelper.findSingleByType(camelContext, VertxPlatformHttpServer.class);
+            if (server != null && server.getServer() != null) {
+                port = server.getServer().actualPort();
+            }
+            if (port == 0) {
+                VertxPlatformHttpServerConfiguration config
+                        = CamelContextHelper.findSingleByType(camelContext, VertxPlatformHttpServerConfiguration.class);
+                if (config != null) {
+                    port = config.getBindPort();
+                }
+            }
+            if (port == 0) {
+                VertxPlatformHttpRouter router = VertxPlatformHttpRouter.lookup(camelContext);
+                if (router != null && router.getServer() != null && router.getServer().getServer() != null) {
+                    port = router.getServer().getServer().actualPort();
+                }
+            }
+        }
+        return port;
+    }
 }
diff --git a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java
index 6cef545c347..0df41432f56 100644
--- a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java
+++ b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import io.vertx.core.Handler;
 import io.vertx.core.Vertx;
 import io.vertx.core.http.HttpMethod;
+import io.vertx.core.http.HttpServer;
 import io.vertx.core.http.HttpServerRequest;
 import io.vertx.ext.web.AllowForwardHeaders;
 import io.vertx.ext.web.Route;
@@ -35,11 +36,13 @@ import org.apache.camel.support.CamelContextHelper;
 public class VertxPlatformHttpRouter implements Router {
     public static final String PLATFORM_HTTP_ROUTER_NAME = PlatformHttpConstants.PLATFORM_HTTP_COMPONENT_NAME + "-router";
 
+    private final VertxPlatformHttpServer server;
     private final Vertx vertx;
     private final Router delegate;
     private AllowForwardHeaders allowForward;
 
-    public VertxPlatformHttpRouter(Vertx vertx, Router delegate) {
+    public VertxPlatformHttpRouter(VertxPlatformHttpServer server, Vertx vertx, Router delegate) {
+        this.server = server;
         this.vertx = vertx;
         this.delegate = delegate;
         this.allowForward = AllowForwardHeaders.NONE;
@@ -49,6 +52,10 @@ public class VertxPlatformHttpRouter implements Router {
         return vertx;
     }
 
+    public VertxPlatformHttpServer getServer() {
+        return server;
+    }
+
     @Override
     public Route route() {
         return delegate.route();
diff --git a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServer.java b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServer.java
index 9b3fa741bd2..9b3791eae6a 100644
--- a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServer.java
+++ b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServer.java
@@ -72,6 +72,10 @@ public class VertxPlatformHttpServer extends ServiceSupport implements CamelCont
         this.context = context;
     }
 
+    public HttpServer getServer() {
+        return server;
+    }
+
     public Vertx getVertx() {
         return vertx;
     }
@@ -151,7 +155,7 @@ public class VertxPlatformHttpServer extends ServiceSupport implements CamelCont
 
         context.getRegistry().bind(
                 VertxPlatformHttpRouter.PLATFORM_HTTP_ROUTER_NAME,
-                new VertxPlatformHttpRouter(vertx, subRouter) {
+                new VertxPlatformHttpRouter(this, vertx, subRouter) {
                     @Override
                     public Handler<RoutingContext> bodyHandler() {
                         return createBodyHandler(configuration);
diff --git a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngineTest.java b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngineTest.java
index ca2cd0bc330..133e26b855f 100644
--- a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngineTest.java
+++ b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpEngineTest.java
@@ -38,6 +38,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Message;
 import org.apache.camel.attachment.AttachmentMessage;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.platform.http.HttpEndpointModel;
 import org.apache.camel.component.platform.http.PlatformHttpComponent;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.model.rest.RestParamType;
@@ -150,9 +151,9 @@ public class VertxPlatformHttpEngineTest {
 
             PlatformHttpComponent phc = context.getComponent("platform-http", PlatformHttpComponent.class);
             assertEquals(2, phc.getHttpEndpoints().size());
-            Iterator<String> it = phc.getHttpEndpoints().iterator();
-            assertEquals("/get", it.next());
-            assertEquals("/post", it.next());
+            Iterator<HttpEndpointModel> it = phc.getHttpEndpoints().iterator();
+            assertEquals("/get", it.next().getUri());
+            assertEquals("/post", it.next().getUri());
 
         } finally {
             context.stop();
diff --git a/components/camel-platform-http/pom.xml b/components/camel-platform-http/pom.xml
index b6a6e1fca07..81ab6a56781 100644
--- a/components/camel-platform-http/pom.xml
+++ b/components/camel-platform-http/pom.xml
@@ -37,6 +37,11 @@
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-support</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-console</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>org.eclipse.jetty</groupId>
             <artifactId>jetty-server</artifactId>
diff --git a/components/camel-platform-http/src/generated/resources/META-INF/services/org/apache/camel/dev-console/platform-http b/components/camel-platform-http/src/generated/resources/META-INF/services/org/apache/camel/dev-console/platform-http
new file mode 100644
index 00000000000..af7b2579928
--- /dev/null
+++ b/components/camel-platform-http/src/generated/resources/META-INF/services/org/apache/camel/dev-console/platform-http
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.platform.http.PlatformHttpConsole
diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/HttpEndpointModel.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/HttpEndpointModel.java
index b89db34c204..5b53a7eadfd 100644
--- a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/HttpEndpointModel.java
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/HttpEndpointModel.java
@@ -16,11 +16,11 @@
  */
 package org.apache.camel.component.platform.http;
 
-import org.apache.camel.util.StringHelper;
-
 import java.util.Locale;
 import java.util.Objects;
 
+import org.apache.camel.util.StringHelper;
+
 /**
  * Model of available http endpoints.
  */
diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpConsole.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpConsole.java
new file mode 100644
index 00000000000..50d5aadd363
--- /dev/null
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpConsole.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.platform.http;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.camel.impl.console.AbstractDevConsole;
+import org.apache.camel.spi.annotations.DevConsole;
+
+@DevConsole("platform-http")
+public class PlatformHttpConsole extends AbstractDevConsole {
+
+    public PlatformHttpConsole() {
+        super("camel", "platform-http", "Platform HTTP", "Embedded HTTP Server");
+    }
+
+    @Override
+    protected Object doCall(MediaType mediaType, Map<String, Object> options) {
+        // only text is supported
+        StringBuilder sb = new StringBuilder();
+
+        PlatformHttpComponent http = getCamelContext().getComponent("platform-http", PlatformHttpComponent.class);
+        if (http != null) {
+            int port = http.getEngine().getServerPort();
+            String server = "http://0.0.0.0:" + port;
+            Set<HttpEndpointModel> models = http.getHttpEndpoints();
+            for (HttpEndpointModel model : models) {
+                if (model.getVerbs() != null) {
+                    sb.append(String.format("    %s%s (%s)\n", server, model.getUri(), model.getVerbs()));
+                } else {
+                    sb.append(String.format("    %s%s\n", server, model.getUri()));
+                }
+            }
+        }
+
+        return sb.toString();
+    }
+
+}
diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/spi/PlatformHttpEngine.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/spi/PlatformHttpEngine.java
index 89e3d4790a9..af5e7cc57b2 100644
--- a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/spi/PlatformHttpEngine.java
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/spi/PlatformHttpEngine.java
@@ -34,4 +34,9 @@ public interface PlatformHttpEngine {
      */
     Consumer createConsumer(PlatformHttpEndpoint platformHttpEndpoint, Processor processor);
 
+    /**
+     * The port number the HTTP server is using
+     */
+    int getServerPort();
+
 }
diff --git a/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpConsumer.java b/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpConsumer.java
index 182de854753..ec3bc5c0ce2 100644
--- a/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpConsumer.java
+++ b/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpConsumer.java
@@ -53,7 +53,6 @@ public class JettyCustomPlatformHttpConsumer extends DefaultConsumer {
         ContextHandler contextHandler = createHandler(endpoint, path);
         // add handler after starting server.
         jettyServerTest.addHandler(contextHandler);
-
     }
 
     private ContextHandler createHandler(PlatformHttpEndpoint endpoint, String path) {
diff --git a/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpEngine.java b/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpEngine.java
index c5301f00150..93c5811a34c 100644
--- a/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpEngine.java
+++ b/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpEngine.java
@@ -19,11 +19,28 @@ package org.apache.camel.component.platform.http;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.component.platform.http.spi.PlatformHttpEngine;
+import org.apache.camel.support.CamelContextHelper;
 
 public class JettyCustomPlatformHttpEngine implements PlatformHttpEngine {
 
+    private int port;
+
     @Override
     public Consumer createConsumer(PlatformHttpEndpoint platformHttpEndpoint, Processor processor) {
+        if (port == 0) {
+            JettyServerTest jettyServerTest = CamelContextHelper.mandatoryLookup(
+                    platformHttpEndpoint.getCamelContext(),
+                    JettyServerTest.JETTY_SERVER_NAME,
+                    JettyServerTest.class);
+
+            port = jettyServerTest.getServerPort();
+        }
+
         return new JettyCustomPlatformHttpConsumer(platformHttpEndpoint, processor);
     }
+
+    @Override
+    public int getServerPort() {
+        return port;
+    }
 }
diff --git a/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyServerTest.java b/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyServerTest.java
index b4c974eb66a..7af9f15a84b 100644
--- a/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyServerTest.java
+++ b/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyServerTest.java
@@ -24,12 +24,14 @@ public class JettyServerTest {
     public static final String JETTY_SERVER_NAME = "JettyServerTest";
 
     private Server server;
+    private int port;
     private HandlerCollection contextHandlerCollection;
 
     public JettyServerTest(int port) {
-        server = new Server(port);
-        contextHandlerCollection = new HandlerCollection(true);
-        server.setHandler(contextHandlerCollection);
+        this.server = new Server(port);
+        this.port = port;
+        this.contextHandlerCollection = new HandlerCollection(true);
+        this.server.setHandler(contextHandlerCollection);
     }
 
     public void start() throws Exception {
@@ -40,14 +42,12 @@ public class JettyServerTest {
         server.stop();
     }
 
-    /**
-     * adds a context handler and starts it
-     *
-     * @param  contextHandler
-     * @throws Exception
-     */
     public void addHandler(ContextHandler contextHandler) throws Exception {
         contextHandlerCollection.addHandler(contextHandler);
         contextHandler.start();
     }
+
+    public int getServerPort() {
+        return port;
+    }
 }


[camel] 01/02: CAMEL-18026: camel-rest - Rest DSL - Output more fine grained http endpoints that are available

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 638aadf20e2ab76deb91a2fc561e0ffdd5104d5e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon May 2 16:56:21 2022 +0200

    CAMEL-18026: camel-rest - Rest DSL - Output more fine grained http endpoints that are available
---
 .../component/platform/http/HttpEndpointModel.java | 84 ++++++++++++++++++++++
 .../platform/http/PlatformHttpComponent.java       | 22 +++---
 .../platform/http/PlatformHttpEndpoint.java        |  4 +-
 .../component/platform/http/PlatformHttpTest.java  |  6 +-
 .../org/apache/camel/main/VertxHttpServer.java     | 18 +++--
 5 files changed, 115 insertions(+), 19 deletions(-)

diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/HttpEndpointModel.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/HttpEndpointModel.java
new file mode 100644
index 00000000000..b89db34c204
--- /dev/null
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/HttpEndpointModel.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.platform.http;
+
+import org.apache.camel.util.StringHelper;
+
+import java.util.Locale;
+import java.util.Objects;
+
+/**
+ * Model of available http endpoints.
+ */
+public class HttpEndpointModel implements Comparable<HttpEndpointModel> {
+
+    private final String uri;
+    private String verbs;
+
+    public HttpEndpointModel(String uri) {
+        this(uri, null);
+    }
+
+    public HttpEndpointModel(String uri, String verbs) {
+        this.uri = uri;
+        addVerb(verbs);
+    }
+
+    public String getUri() {
+        return uri;
+    }
+
+    public String getVerbs() {
+        return verbs;
+    }
+
+    public void addVerb(String verb) {
+        if (verb != null) {
+            if (this.verbs == null) {
+                this.verbs = "";
+            }
+            if (!StringHelper.containsIgnoreCase(this.verbs, verb)) {
+                if (!this.verbs.isEmpty()) {
+                    this.verbs += ",";
+                }
+                this.verbs += verb.toUpperCase(Locale.US);
+            }
+        }
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        HttpEndpointModel that = (HttpEndpointModel) o;
+        return uri.equals(that.uri);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(uri);
+    }
+
+    @Override
+    public int compareTo(HttpEndpointModel o) {
+        return uri.compareTo(o.uri);
+    }
+}
diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java
index e382d9decad..9dc2775bc90 100644
--- a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java
@@ -53,7 +53,7 @@ public class PlatformHttpComponent extends DefaultComponent implements RestConsu
     @Metadata(label = "advanced", description = "An HTTP Server engine implementation to serve the requests")
     private volatile PlatformHttpEngine engine;
 
-    private final Set<String> httpEndpoints = new TreeSet<>();
+    private final Set<HttpEndpointModel> httpEndpoints = new TreeSet<>();
 
     private volatile boolean localEngine;
 
@@ -84,7 +84,7 @@ public class PlatformHttpComponent extends DefaultComponent implements RestConsu
         // reuse the createConsumer method we already have. The api need to use GET and match on uri prefix
         Consumer consumer = doCreateConsumer(camelContext, processor, "GET", contextPath, null, null, null, configuration,
                 parameters, true);
-        addHttpEndpoint(contextPath);
+        addHttpEndpoint(contextPath, "GET");
         return consumer;
     }
 
@@ -98,9 +98,9 @@ public class PlatformHttpComponent extends DefaultComponent implements RestConsu
                 = doCreateConsumer(camelContext, processor, verb, basePath, uriTemplate, consumes, produces, configuration,
                         parameters, false);
         if (uriTemplate != null) {
-            addHttpEndpoint(basePath + "/" + uriTemplate);
+            addHttpEndpoint(basePath + "/" + uriTemplate, verb);
         } else {
-            addHttpEndpoint(basePath);
+            addHttpEndpoint(basePath, verb);
         }
         return consumer;
     }
@@ -108,21 +108,27 @@ public class PlatformHttpComponent extends DefaultComponent implements RestConsu
     /**
      * Adds a known http endpoint managed by this component.
      */
-    public void addHttpEndpoint(String uri) {
-        httpEndpoints.add(uri);
+    public void addHttpEndpoint(String uri, String verbs) {
+        HttpEndpointModel model = httpEndpoints.stream().filter(e -> e.getUri().equals(uri)).findFirst().orElse(null);
+        if (model == null) {
+            model = new HttpEndpointModel(uri, verbs);
+            httpEndpoints.add(model);
+        } else {
+            model.addVerb(verbs);
+        }
     }
 
     /**
      * Removes a known http endpoint managed by this component.
      */
     public void removeHttpEndpoint(String uri) {
-        httpEndpoints.remove(uri);
+        httpEndpoints.stream().filter(e -> e.getUri().equals(uri)).findFirst().ifPresent(httpEndpoints::remove);
     }
 
     /**
      * Lists the known http endpoints managed by this component. The endpoints are without host:port/[context-path]
      */
-    public Set<String> getHttpEndpoints() {
+    public Set<HttpEndpointModel> getHttpEndpoints() {
         return Collections.unmodifiableSet(httpEndpoints);
     }
 
diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpEndpoint.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpEndpoint.java
index c0615147672..db5ca28e7fe 100644
--- a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpEndpoint.java
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpEndpoint.java
@@ -106,7 +106,7 @@ public class PlatformHttpEndpoint extends DefaultEndpoint implements AsyncEndpoi
             protected void doStart() throws Exception {
                 super.doStart();
                 ServiceHelper.startService(delegatedConsumer);
-                getComponent().addHttpEndpoint(getPath());
+                getComponent().addHttpEndpoint(getPath(), httpMethodRestrict);
             }
 
             @Override
@@ -205,6 +205,6 @@ public class PlatformHttpEndpoint extends DefaultEndpoint implements AsyncEndpoi
     PlatformHttpEngine getOrCreateEngine() {
         return platformHttpEngine != null
                 ? platformHttpEngine
-                : ((PlatformHttpComponent) getComponent()).getOrCreateEngine();
+                : getComponent().getOrCreateEngine();
     }
 }
diff --git a/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/PlatformHttpTest.java b/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/PlatformHttpTest.java
index cf3e9511f36..a7e0ad0f018 100644
--- a/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/PlatformHttpTest.java
+++ b/components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/PlatformHttpTest.java
@@ -52,9 +52,9 @@ public class PlatformHttpTest extends AbstractPlatformHttpTest {
 
         PlatformHttpComponent phc = getContext().getComponent("platform-http", PlatformHttpComponent.class);
         assertEquals(2, phc.getHttpEndpoints().size());
-        Iterator<String> it = phc.getHttpEndpoints().iterator();
-        assertEquals("/get", it.next());
-        assertEquals("/post", it.next());
+        Iterator<HttpEndpointModel> it = phc.getHttpEndpoints().iterator();
+        assertEquals("/get", it.next().getUri());
+        assertEquals("/post", it.next().getUri());
     }
 
     @Override
diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/VertxHttpServer.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/VertxHttpServer.java
index 7312e52e516..877bf93c816 100644
--- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/VertxHttpServer.java
+++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/VertxHttpServer.java
@@ -35,6 +35,7 @@ import io.vertx.ext.web.RoutingContext;
 import org.apache.camel.CamelContext;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.StartupListener;
+import org.apache.camel.component.platform.http.HttpEndpointModel;
 import org.apache.camel.component.platform.http.PlatformHttpComponent;
 import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpRouter;
 import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpServer;
@@ -100,7 +101,7 @@ public final class VertxHttpServer {
                 public void onCamelContextStarted(CamelContext context, boolean alreadyStarted) throws Exception {
                     camelContext.getManagementStrategy().addEventNotifier(new SimpleEventNotifierSupport() {
 
-                        private Set<String> last;
+                        private Set<HttpEndpointModel> last;
 
                         @Override
                         public boolean isEnabled(CamelEvent event) {
@@ -119,7 +120,7 @@ public final class VertxHttpServer {
                                 }
                             }
 
-                            Set<String> endpoints = phc.getHttpEndpoints();
+                            Set<HttpEndpointModel> endpoints = phc.getHttpEndpoints();
                             if (endpoints.isEmpty()) {
                                 return;
                             }
@@ -127,8 +128,13 @@ public final class VertxHttpServer {
                             // log only if changed
                             if (last == null || last.size() != endpoints.size() || !last.containsAll(endpoints)) {
                                 LOG.info("HTTP endpoints summary");
-                                for (String u : endpoints) {
-                                    LOG.info("    http://0.0.0.0:" + port + u);
+                                for (HttpEndpointModel u : endpoints) {
+                                    String v = u.getVerbs();
+                                    String line = "http://0.0.0.0:" + port + u.getUri();
+                                    if (u.getVerbs() != null) {
+                                        line += " (" + u.getVerbs() + ")";
+                                    }
+                                    LOG.info("    {}", line);
                                 }
                             }
 
@@ -183,7 +189,7 @@ public final class VertxHttpServer {
                 }
             }
         });
-        phc.addHttpEndpoint("/q/dev");
+        phc.addHttpEndpoint("/q/dev", null);
     }
 
     public static void registerHealthCheck(CamelContext camelContext) {
@@ -254,7 +260,7 @@ public final class VertxHttpServer {
         live.handler(handler);
         ready.handler(handler);
 
-        phc.addHttpEndpoint("/q/health");
+        phc.addHttpEndpoint("/q/health", null);
     }
 
     private static void healthCheckStatus(StringBuilder sb, boolean up) {