You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/12/18 20:26:52 UTC

[camel-quarkus] branch master updated: Add camel-endpointdsl extension #551

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

lburgazzoli 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 a54053a  Add camel-endpointdsl extension #551
a54053a is described below

commit a54053a2cac86ce698cc650f2e7a287f4f1e02a9
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed Dec 18 14:31:29 2019 +0100

    Add camel-endpointdsl extension #551
---
 .../pages/list-of-camel-quarkus-extensions.adoc    |  4 +-
 extensions/endpointdsl/deployment/pom.xml          | 73 +++++++++++++++++++
 .../deployment/EndpointDSLProcessor.java           | 29 ++++++++
 extensions/endpointdsl/pom.xml                     | 37 ++++++++++
 extensions/endpointdsl/runtime/pom.xml             | 81 ++++++++++++++++++++++
 .../main/resources/META-INF/quarkus-extension.yaml | 26 +++++++
 extensions/pom.xml                                 |  1 +
 extensions/readme.adoc                             |  4 +-
 integration-tests/core-main/pom.xml                |  4 ++
 .../quarkus/core/CamelRouteWithEndpointDSL.java    | 29 ++++++++
 .../org/apache/camel/quarkus/core/CamelTest.java   |  2 +-
 poms/bom-deployment/pom.xml                        |  5 ++
 poms/bom/pom.xml                                   | 10 +++
 13 files changed, 302 insertions(+), 3 deletions(-)

diff --git a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
index e8c7090..bbbeb53 100644
--- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
+++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
@@ -229,7 +229,7 @@ Number of Camel languages: 8 in 2 JAR artifacts (0 deprecated)
 == Miscellaneous Extensions
 
 // others: START
-Number of miscellaneous extensions: 8 in 8 JAR artifacts (0 deprecated)
+Number of miscellaneous extensions: 9 in 9 JAR artifacts (0 deprecated)
 
 [width="100%",cols="4,1,5",options="header"]
 |===
@@ -241,6 +241,8 @@ Number of miscellaneous extensions: 8 in 8 JAR artifacts (0 deprecated)
 
 | (camel-quarkus-core-xml) | 0.3.0 | Includes implementations of Java Architecture for XML Binding (JAXB) and Java API for XML Processing (JAXP)
 
+| (camel-quarkus-endpointdsl) | 1.0.0 | camel-quarkus-endpointdsl
+
 | (camel-quarkus-hystrix) | 1.0.0-M1 | Circuit Breaker EIP using Netflix Hystrix
 
 | (camel-quarkus-kotlin) | 1.0.0 | camel-quarkus-kotlin
diff --git a/extensions/endpointdsl/deployment/pom.xml b/extensions/endpointdsl/deployment/pom.xml
new file mode 100644
index 0000000..80d7907
--- /dev/null
+++ b/extensions/endpointdsl/deployment/pom.xml
@@ -0,0 +1,73 @@
+<?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-endpointdsl-parent</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-endpointdsl-deployment</artifactId>
+    <name>Camel Quarkus :: Endpoint DSL :: Deployment</name>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom-deployment</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-core-deployment</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-endpointdsl</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/endpointdsl/deployment/src/main/java/org/apache/camel/quarkus/endpointdsl/deployment/EndpointDSLProcessor.java b/extensions/endpointdsl/deployment/src/main/java/org/apache/camel/quarkus/endpointdsl/deployment/EndpointDSLProcessor.java
new file mode 100644
index 0000000..b8b6867
--- /dev/null
+++ b/extensions/endpointdsl/deployment/src/main/java/org/apache/camel/quarkus/endpointdsl/deployment/EndpointDSLProcessor.java
@@ -0,0 +1,29 @@
+/*
+ * 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.endpointdsl.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+
+class EndpointDSLProcessor {
+    private static final String FEATURE = "camel-endpointdsl";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+}
diff --git a/extensions/endpointdsl/pom.xml b/extensions/endpointdsl/pom.xml
new file mode 100644
index 0000000..9cafb22
--- /dev/null
+++ b/extensions/endpointdsl/pom.xml
@@ -0,0 +1,37 @@
+<?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-endpointdsl-parent</artifactId>
+    <name>Camel Quarkus :: Endpoint DSL</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>deployment</module>
+        <module>runtime</module>
+    </modules>
+</project>
diff --git a/extensions/endpointdsl/runtime/pom.xml b/extensions/endpointdsl/runtime/pom.xml
new file mode 100644
index 0000000..3ea3c45
--- /dev/null
+++ b/extensions/endpointdsl/runtime/pom.xml
@@ -0,0 +1,81 @@
+<?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-endpointdsl-parent</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-endpointdsl</artifactId>
+    <name>Camel Quarkus :: Endpoint DSL :: Runtime</name>
+    <description>camel-quarkus-endpointdsl</description>
+
+    <properties>
+        <firstVersion>1.0.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>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-endpointdsl</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <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/endpointdsl/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/endpointdsl/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000..a9221f8
--- /dev/null
+++ b/extensions/endpointdsl/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+---
+name: "Camel Quarkus Endpoint DSL"
+description: "Camel Endpoint DSL"
+metadata:
+  keywords:
+  - "camel"
+  guide: "https://quarkus.io/guides/camel"
+  categories:
+  - "integration"
\ No newline at end of file
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 1b73f3f..68c3b82 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -59,6 +59,7 @@
         <module>dataformat</module>
         <module>direct</module>
         <module>dozer</module>
+        <module>endpointdsl</module>
         <module>exec</module>
         <module>fhir</module>
         <module>file</module>
diff --git a/extensions/readme.adoc b/extensions/readme.adoc
index e15bb4b..2cec3bf 100644
--- a/extensions/readme.adoc
+++ b/extensions/readme.adoc
@@ -231,7 +231,7 @@ Number of Camel languages: 8 in 2 JAR artifacts (0 deprecated)
 == Miscellaneous Extensions
 
 // others: START
-Number of miscellaneous extensions: 8 in 8 JAR artifacts (0 deprecated)
+Number of miscellaneous extensions: 9 in 9 JAR artifacts (0 deprecated)
 
 [width="100%",cols="4,1,5",options="header"]
 |===
@@ -243,6 +243,8 @@ Number of miscellaneous extensions: 8 in 8 JAR artifacts (0 deprecated)
 
 | (camel-quarkus-core-xml) | 0.3.0 | Includes implementations of Java Architecture for XML Binding (JAXB) and Java API for XML Processing (JAXP)
 
+| (camel-quarkus-endpointdsl) | 1.0.0 | camel-quarkus-endpointdsl
+
 | (camel-quarkus-hystrix) | 1.0.0-M1 | Circuit Breaker EIP using Netflix Hystrix
 
 | (camel-quarkus-kotlin) | 1.0.0 | camel-quarkus-kotlin
diff --git a/integration-tests/core-main/pom.xml b/integration-tests/core-main/pom.xml
index 7abe7d8..bb0a336 100644
--- a/integration-tests/core-main/pom.xml
+++ b/integration-tests/core-main/pom.xml
@@ -36,6 +36,10 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-endpointdsl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-reactive-executor</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/core-main/src/main/java/org/apache/camel/quarkus/core/CamelRouteWithEndpointDSL.java b/integration-tests/core-main/src/main/java/org/apache/camel/quarkus/core/CamelRouteWithEndpointDSL.java
new file mode 100644
index 0000000..73d9180
--- /dev/null
+++ b/integration-tests/core-main/src/main/java/org/apache/camel/quarkus/core/CamelRouteWithEndpointDSL.java
@@ -0,0 +1,29 @@
+/*
+ * 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.core;
+
+import org.apache.camel.builder.endpoint.EndpointRouteBuilder;
+
+public class CamelRouteWithEndpointDSL extends EndpointRouteBuilder {
+
+    @Override
+    public void configure() {
+        from(direct("endpointdsl"))
+                .id("endpointdsl")
+                .to("log:keep-alive");
+    }
+}
diff --git a/integration-tests/core-main/src/test/java/org/apache/camel/quarkus/core/CamelTest.java b/integration-tests/core-main/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
index 4a79b0e..0109b68 100644
--- a/integration-tests/core-main/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
+++ b/integration-tests/core-main/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
@@ -101,7 +101,7 @@ public class CamelTest {
                 .contains(CamelRoute.class.getName())
                 .doesNotContain(CamelRouteFiltered.class.getName());
         assertThat(p.getList("routes", String.class))
-                .contains("keep-alive", "configure", "beforeStart", "produced")
+                .contains("keep-alive", "configure", "beforeStart", "produced", "endpointdsl")
                 .doesNotContain("filtered");
 
         assertThat(p.getBoolean("autoConfigurationLogSummary")).isFalse();
diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml
index 0fcc109..b469702 100644
--- a/poms/bom-deployment/pom.xml
+++ b/poms/bom-deployment/pom.xml
@@ -160,6 +160,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-endpointdsl-deployment</artifactId>
+                <version>${camel-quarkus.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
                 <artifactId>camel-quarkus-exec-deployment</artifactId>
                 <version>${camel-quarkus.version}</version>
             </dependency>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 3441ad5..320d5c6 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -163,6 +163,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel</groupId>
+                <artifactId>camel-endpointdsl</artifactId>
+                <version>${camel.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel</groupId>
                 <artifactId>camel-exec</artifactId>
                 <version>${camel.version}</version>
             </dependency>
@@ -524,6 +529,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-endpointdsl</artifactId>
+                <version>${camel-quarkus.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
                 <artifactId>camel-quarkus-exec</artifactId>
                 <version>${camel-quarkus.version}</version>
             </dependency>