You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2020/09/02 16:51:07 UTC
[camel-quarkus] branch master updated: Add vertx-http component
extension
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push:
new 8a276a1 Add vertx-http component extension
8a276a1 is described below
commit 8a276a13b3ae6b4a9e3be02cc125033c3384e9ec
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Sep 2 15:59:58 2020 +0100
Add vertx-http component extension
Fixes #1491
---
catalog/pom.xml | 1 +
docs/modules/ROOT/nav.adoc | 1 +
docs/modules/ROOT/pages/reference/components.adoc | 3 +
.../pages/reference/extensions/vertx-http.adoc | 29 +++++++
docs/modules/ROOT/pages/reference/index.adoc | 3 +
extensions/pom.xml | 1 +
extensions/vertx-http/deployment/pom.xml | 67 +++++++++++++++
.../vertx/http/deployment/VertxHttpProcessor.java | 44 ++++++++++
extensions/vertx-http/pom.xml | 39 +++++++++
extensions/vertx-http/runtime/pom.xml | 98 ++++++++++++++++++++++
.../vertx/http/CamelVertxHttpRecorder.java | 53 ++++++++++++
.../main/resources/META-INF/quarkus-extension.yaml | 31 +++++++
integration-tests/http/pom.xml | 6 +-
.../quarkus/component/http/it/HttpResource.java | 39 +++++++++
.../camel/quarkus/component/http/it/HttpTest.java | 5 +-
poms/bom/pom.xml | 15 ++++
16 files changed, 431 insertions(+), 4 deletions(-)
diff --git a/catalog/pom.xml b/catalog/pom.xml
index ce96aaf..8742954 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -276,6 +276,7 @@
camel-quarkus-validator
camel-quarkus-velocity
camel-quarkus-vertx
+ camel-quarkus-vertx-http
camel-quarkus-vm
camel-quarkus-weather
camel-quarkus-web3j
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 7dffb40..1f2965f 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -228,6 +228,7 @@
*** xref:reference/extensions/validator.adoc[Validator]
*** xref:reference/extensions/velocity.adoc[Velocity]
*** xref:reference/extensions/vertx.adoc[Vert.x]
+*** xref:reference/extensions/vertx-http.adoc[Vert.x HTTP Client]
*** xref:reference/extensions/vm.adoc[VM]
*** xref:reference/extensions/weather.adoc[Weather]
*** xref:reference/extensions/web3j.adoc[Web3j Ethereum Blockchain]
diff --git a/docs/modules/ROOT/pages/reference/components.adoc b/docs/modules/ROOT/pages/reference/components.adoc
index 09da315..69d1ad2 100644
--- a/docs/modules/ROOT/pages/reference/components.adoc
+++ b/docs/modules/ROOT/pages/reference/components.adoc
@@ -721,6 +721,9 @@ Preview | 1.1.0 | Transform messages using a Velocity template.
| xref:reference/extensions/vertx.adoc[Vert.x] | [.camel-element-artifact]##camel-quarkus-vertx## | [.camel-element-Native]##Native## +
Stable | 1.0.0 | Send and receive messages to/from Vert.x Event Bus.
+| xref:reference/extensions/vertx-http.adoc[Vert.x HTTP Client] | [.camel-element-artifact]##camel-quarkus-vertx-http## | [.camel-element-Native]##Native## +
+Stable | 1.1.0 | Camel HTTP client support with Vert.x
+
| xref:reference/extensions/vm.adoc[VM] | [.camel-element-artifact]##camel-quarkus-vm## | [.camel-element-Native]##Native## +
Stable | 0.3.0 | Call another endpoint in the same CamelContext asynchronously.
diff --git a/docs/modules/ROOT/pages/reference/extensions/vertx-http.adoc b/docs/modules/ROOT/pages/reference/extensions/vertx-http.adoc
new file mode 100644
index 0000000..864b711
--- /dev/null
+++ b/docs/modules/ROOT/pages/reference/extensions/vertx-http.adoc
@@ -0,0 +1,29 @@
+// Do not edit directly!
+// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
+
+[[vertx-http]]
+= Vert.x HTTP Client
+:page-aliases: extensions/vertx-http.adoc
+
+[.badges]
+[.badge-key]##Since Camel Quarkus##[.badge-version]##1.1.0## [.badge-key]##JVM##[.badge-supported]##supported## [.badge-key]##Native##[.badge-supported]##supported##
+
+Camel HTTP client support with Vert.x
+
+== What's inside
+
+* https://camel.apache.org/components/latest/vertx-http-component.html[Vert.x HTTP Client component], URI syntax: `vertx-http:httpUri`
+
+Please refer to the above link for usage and configuration details.
+
+== Maven coordinates
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-vertx-http</artifactId>
+</dependency>
+----
+
+Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
diff --git a/docs/modules/ROOT/pages/reference/index.adoc b/docs/modules/ROOT/pages/reference/index.adoc
index 0a400c3..d6460fb 100644
--- a/docs/modules/ROOT/pages/reference/index.adoc
+++ b/docs/modules/ROOT/pages/reference/index.adoc
@@ -662,6 +662,9 @@ Preview | 1.1.0 | Transform messages using a Velocity template.
| xref:reference/extensions/vertx.adoc[Vert.x] | camel-quarkus-vertx | [.camel-element-Native]##Native## +
Stable | 1.0.0 | Send and receive messages to/from Vert.x Event Bus.
+| xref:reference/extensions/vertx-http.adoc[Vert.x HTTP Client] | camel-quarkus-vertx-http | [.camel-element-Native]##Native## +
+Stable | 1.1.0 | Camel HTTP client support with Vert.x
+
| xref:reference/extensions/vm.adoc[VM] | camel-quarkus-vm | [.camel-element-Native]##Native## +
Stable | 0.3.0 | Call another endpoint in the same CamelContext asynchronously.
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 15a1df3..3bdc46f 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -174,6 +174,7 @@
<module>twitter</module>
<module>validator</module>
<module>vertx</module>
+ <module>vertx-http</module>
<module>vm</module>
<module>websocket-jsr356</module>
<module>xpath</module>
diff --git a/extensions/vertx-http/deployment/pom.xml b/extensions/vertx-http/deployment/pom.xml
new file mode 100644
index 0000000..6dbee13
--- /dev/null
+++ b/extensions/vertx-http/deployment/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-vertx-http-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-vertx-http-deployment</artifactId>
+ <name>Camel Quarkus :: Vert.x HTTP Client :: Deployment</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-vertx-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-vertx-http</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/extensions/vertx-http/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/http/deployment/VertxHttpProcessor.java b/extensions/vertx-http/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/http/deployment/VertxHttpProcessor.java
new file mode 100644
index 0000000..4375f20
--- /dev/null
+++ b/extensions/vertx-http/deployment/src/main/java/org/apache/camel/quarkus/component/vertx/http/deployment/VertxHttpProcessor.java
@@ -0,0 +1,44 @@
+/*
+ * 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.quarkus.component.vertx.http.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.annotations.ExecutionTime;
+import io.quarkus.deployment.annotations.Record;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.vertx.deployment.VertxBuildItem;
+import org.apache.camel.component.vertx.http.VertxHttpComponent;
+import org.apache.camel.quarkus.component.vertx.http.CamelVertxHttpRecorder;
+import org.apache.camel.quarkus.core.deployment.spi.CamelRuntimeBeanBuildItem;
+
+class VertxHttpProcessor {
+
+ private static final String FEATURE = "camel-vertx-http";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @Record(ExecutionTime.RUNTIME_INIT)
+ @BuildStep
+ CamelRuntimeBeanBuildItem configureVertxComponent(CamelVertxHttpRecorder recorder, VertxBuildItem vertx) {
+ return new CamelRuntimeBeanBuildItem("vertx-http", VertxHttpComponent.class.getName(),
+ recorder.createVertxHttpComponent(vertx.getVertx()));
+ }
+
+}
diff --git a/extensions/vertx-http/pom.xml b/extensions/vertx-http/pom.xml
new file mode 100644
index 0000000..ff2f566
--- /dev/null
+++ b/extensions/vertx-http/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-vertx-http-parent</artifactId>
+ <name>Camel Quarkus :: Vert.x HTTP Client</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>deployment</module>
+ <module>runtime</module>
+ </modules>
+</project>
diff --git a/extensions/vertx-http/runtime/pom.xml b/extensions/vertx-http/runtime/pom.xml
new file mode 100644
index 0000000..5bd6564
--- /dev/null
+++ b/extensions/vertx-http/runtime/pom.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-vertx-http-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-vertx-http</artifactId>
+ <name>Camel Quarkus :: Vert.x HTTP Client :: Runtime</name>
+ <description>Camel HTTP client support with Vert.x</description>
+
+ <properties>
+ <firstVersion>1.1.0</firstVersion>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-vertx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-vertx-http</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>update-extension-doc-page</id>
+ <goals><goal>update-extension-doc-page</goal></goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/extensions/vertx-http/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/http/CamelVertxHttpRecorder.java b/extensions/vertx-http/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/http/CamelVertxHttpRecorder.java
new file mode 100644
index 0000000..e59be03
--- /dev/null
+++ b/extensions/vertx-http/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/http/CamelVertxHttpRecorder.java
@@ -0,0 +1,53 @@
+/*
+ * 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.quarkus.component.vertx.http;
+
+import io.quarkus.runtime.RuntimeValue;
+import io.quarkus.runtime.annotations.Recorder;
+import io.vertx.core.Vertx;
+import io.vertx.core.buffer.Buffer;
+import io.vertx.ext.web.client.HttpRequest;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.vertx.http.DefaultVertxHttpBinding;
+import org.apache.camel.component.vertx.http.VertxHttpComponent;
+import org.apache.camel.spi.HeaderFilterStrategy;
+import org.apache.camel.support.ExchangeHelper;
+import org.apache.camel.util.ObjectHelper;
+
+@Recorder
+public class CamelVertxHttpRecorder {
+
+ public RuntimeValue<?> createVertxHttpComponent(RuntimeValue<Vertx> vertx) {
+ VertxHttpComponent component = new VertxHttpComponent();
+ component.setVertx(vertx.getValue());
+ component.setVertxHttpBinding(new QuarkusVertxHttpBinding());
+ return new RuntimeValue<>(component);
+ }
+
+ // TODO: Remove when https://issues.apache.org/jira/browse/CAMEL-15495 is resolved
+ static class QuarkusVertxHttpBinding extends DefaultVertxHttpBinding {
+ @Override
+ public void populateRequestHeaders(Exchange exchange, HttpRequest<Buffer> request, HeaderFilterStrategy strategy) {
+ super.populateRequestHeaders(exchange, request, strategy);
+
+ String contentType = ExchangeHelper.getContentType(exchange);
+ if (ObjectHelper.isNotEmpty(contentType)) {
+ request.putHeader(Exchange.CONTENT_TYPE, contentType);
+ }
+ }
+ }
+}
diff --git a/extensions/vertx-http/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/vertx-http/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000..49a1a7f
--- /dev/null
+++ b/extensions/vertx-http/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,31 @@
+#
+# 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.
+#
+
+# This is a generated file. Do not edit directly!
+# To re-generate, run the following command from the top level directory:
+#
+# mvn -N cq:update-quarkus-metadata
+#
+---
+name: "Camel Vert.x HTTP Client"
+description: "Camel HTTP client support with Vert.x"
+metadata:
+ guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/vertx-http.html"
+ categories:
+ - "integration"
+ status:
+ - "stable"
diff --git a/integration-tests/http/pom.xml b/integration-tests/http/pom.xml
index 067e429..0f41c2a 100644
--- a/integration-tests/http/pom.xml
+++ b/integration-tests/http/pom.xml
@@ -36,7 +36,7 @@
<!-- explicit dependencies of this module in the Maven sense, although they are required by the Quarkus Maven plugin. -->
<!-- Please update the rule whenever you change the dependencies of this module by running -->
<!-- mvn process-resources -Pformat from the root directory -->
- <mvnd.builder.rule>camel-quarkus-ahc-deployment,camel-quarkus-ahc-ws-deployment,camel-quarkus-direct-deployment,camel-quarkus-http-deployment,camel-quarkus-netty-http-deployment</mvnd.builder.rule>
+ <mvnd.builder.rule>camel-quarkus-ahc-deployment,camel-quarkus-ahc-ws-deployment,camel-quarkus-direct-deployment,camel-quarkus-http-deployment,camel-quarkus-netty-http-deployment,camel-quarkus-vertx-http-deployment</mvnd.builder.rule>
</properties>
<dependencies>
@@ -61,6 +61,10 @@
<artifactId>camel-quarkus-netty-http</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-vertx-http</artifactId>
+ </dependency>
+ <dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-undertow-websockets</artifactId>
</dependency>
diff --git a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java
index dcb7616..a35d590 100644
--- a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java
+++ b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpResource.java
@@ -173,4 +173,43 @@ public class HttpResource {
.withHeader(Exchange.HTTP_METHOD, "POST")
.request(String.class);
}
+
+ // *****************************
+ //
+ // camel-vertx-http
+ //
+ // *****************************
+
+ @Path("/vertx-http/get")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String vertxHttpGet(@QueryParam("test-port") int port) {
+ return producerTemplate
+ .to("vertx-http:http://localhost:" + port + "/service/get")
+ .withHeader(Exchange.HTTP_METHOD, "GET")
+ .request(String.class);
+ }
+
+ @Path("/vertx-http/get-https")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String vertxHttpHttps() {
+ return producerTemplate
+ .to("vertx-http:https://restcountries.com/v2/alpha/cz")
+ .withHeader(Exchange.HTTP_METHOD, "GET")
+ .request(String.class);
+ }
+
+ @Path("/vertx-http/post")
+ @POST
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.TEXT_PLAIN)
+ public String vertxHttpPost(@QueryParam("test-port") int port, String message) {
+ return producerTemplate
+ .to("vertx-http:http://localhost:" + port + "/service/toUpper")
+ .withBody(message)
+ .withHeader(Exchange.CONTENT_TYPE, MediaType.TEXT_PLAIN)
+ .withHeader(Exchange.HTTP_METHOD, "POST")
+ .request(String.class);
+ }
}
diff --git a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java
index a730a72..c794889 100644
--- a/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java
+++ b/integration-tests/http/src/test/java/org/apache/camel/quarkus/component/http/it/HttpTest.java
@@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.is;
@QuarkusTestResource(TrustStoreResource.class)
class HttpTest {
@ParameterizedTest
- @ValueSource(strings = { "ahc", "http", "netty-http" })
+ @ValueSource(strings = { "ahc", "http", "netty-http", "vertx-http" })
public void basicProducer(String component) {
RestAssured
.given()
@@ -53,8 +53,7 @@ class HttpTest {
}
@ParameterizedTest
- @ValueSource(strings = { "ahc",
- "http", "netty-http" })
+ @ValueSource(strings = { "ahc", "http", "netty-http", "vertx-http" })
public void httpsProducer(String component) {
RestAssured
.given()
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 2bc9d8c..4d024bf 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -1508,6 +1508,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-vertx-http</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-vm</artifactId>
<version>${camel.version}</version>
</dependency>
@@ -3970,6 +3975,16 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-vertx-http</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-vertx-http-deployment</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-vm</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>