2.46.3.2. 通过 Camel REST DSL 使用 platform-http
要将 Camel REST DSL 与 platform-http 组件搭配使用,除了 camel-quarkus- http 之外,还需要将 camel-quarkus-http 添加到 pom.xml :
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest</artifactId>
</dependency>
然后您可以使用 Camel REST DSL:
rest()
.get("/my-get-endpoint")
.route()
.setBody(constant("Hello from /my-get-endpoint"))
.endRest()
.post("/my-post-endpoint")
.route()
.setBody(constant("Hello from /my-post-endpoint"))
.endRest();