You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/09/24 15:04:20 UTC

[camel-examples] branch master updated (d6b1943 -> 99e9a9e)

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

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-examples.git.


    from d6b1943  Merge pull request #20 from apache/asf-yaml
     new 5857498  Spike for aws2-s3 endpoint DSL
     new 9c7d11b  Added a little example of AWS2-S3 with camel-main and endpoint dsl
     new 7c918e3  Added AWS2-S3 Endpoint DSL to module list in pom
     new bf06d71  Added Wsdl4j-version property placeholder back
     new 99e9a9e  Regen README

The 5 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:
 examples/README.adoc                                       |  4 +++-
 .../pom.xml                                                |  8 ++++----
 .../readme.adoc                                            |  4 +++-
 .../main/java/org/apache/camel/example/MyApplication.java  |  0
 .../main/java/org/apache/camel/example/MyRouteBuilder.java | 13 +++++++------
 .../src/main/resources/application.properties              | 14 ++++++--------
 .../src/main/resources/logback.xml                         |  0
 examples/pom.xml                                           |  2 ++
 8 files changed, 25 insertions(+), 20 deletions(-)
 copy examples/{camel-example-main-endpointdsl => camel-example-main-endpointdsl-aws2-s3}/pom.xml (93%)
 copy examples/{camel-example-main-endpointdsl => camel-example-main-endpointdsl-aws2-s3}/readme.adoc (81%)
 copy examples/{camel-example-main-tiny => camel-example-main-endpointdsl-aws2-s3}/src/main/java/org/apache/camel/example/MyApplication.java (100%)
 copy examples/{camel-example-main-artemis => camel-example-main-endpointdsl-aws2-s3}/src/main/java/org/apache/camel/example/MyRouteBuilder.java (72%)
 copy examples/{camel-example-reactive-executor-vertx => camel-example-main-endpointdsl-aws2-s3}/src/main/resources/application.properties (83%)
 copy examples/{camel-example-routetemplate => camel-example-main-endpointdsl-aws2-s3}/src/main/resources/logback.xml (100%)


[camel-examples] 04/05: Added Wsdl4j-version property placeholder back

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-examples.git

commit bf06d714f331c686d161c48997bfa6eb066d3d04
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Sep 24 14:53:10 2020 +0200

    Added Wsdl4j-version property placeholder back
---
 examples/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/pom.xml b/examples/pom.xml
index 58cbd48..e824d56 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -193,6 +193,7 @@
         <xmlunit-version>1.6</xmlunit-version>
         <derby-version>10.14.2.0</derby-version>
         <jkube-version>1.0.0</jkube-version>
+        <wsdl4j-version>1.6.3</wsdl4j-version>
     </properties>
 
     <!-- Comment out the snapshot repositories as we don't need them now -->


[camel-examples] 03/05: Added AWS2-S3 Endpoint DSL to module list in pom

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-examples.git

commit 7c918e3a7e225d4ed9e3b3905e1ee3c8a54e8ed1
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Sep 24 14:51:30 2020 +0200

    Added AWS2-S3 Endpoint DSL to module list in pom
---
 examples/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/pom.xml b/examples/pom.xml
index 15e24be..58cbd48 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -124,6 +124,7 @@
         <module>camel-example-main</module>
         <module>camel-example-main-artemis</module>
         <module>camel-example-main-endpointdsl</module>
+        <module>camel-example-main-endpointdsl-aws2-s3</module>
         <module>camel-example-main-health</module>
         <module>camel-example-main-tiny</module>
         <module>camel-example-main-xml</module>


[camel-examples] 01/05: Spike for aws2-s3 endpoint DSL

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-examples.git

commit 58574984baa1d03d9fec27d0d707d3d3168ca17f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Sep 22 12:07:21 2020 +0200

    Spike for aws2-s3 endpoint DSL
---
 .../camel-example-main-endpointdsl-aws2-s3/pom.xml | 102 +++++++++++++++++++++
 .../readme.adoc                                    |  23 +++++
 .../org/apache/camel/example/MyApplication.java    |  38 ++++++++
 .../org/apache/camel/example/MyRouteBuilder.java   |  33 +++++++
 .../src/main/resources/application.properties      |  34 +++++++
 .../src/main/resources/logback.xml                 |  30 ++++++
 6 files changed, 260 insertions(+)

diff --git a/examples/camel-example-main-endpointdsl-aws2-s3/pom.xml b/examples/camel-example-main-endpointdsl-aws2-s3/pom.xml
new file mode 100644
index 0000000..2cdb311
--- /dev/null
+++ b/examples/camel-example-main-endpointdsl-aws2-s3/pom.xml
@@ -0,0 +1,102 @@
+<?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/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel.example</groupId>
+        <artifactId>examples</artifactId>
+        <version>3.6.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-main-endpointdsl-aws2-s3</artifactId>
+    <packaging>jar</packaging>
+    <name>Camel :: Example :: Main :: Endpoint DSL :: AWS2 S3</name>
+    <description>An example for showing standalone Camel with Endpoint DSL and AWS2-S3</description>
+
+    <properties>
+        <category>Beginner</category>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- Add Camel BOM -->
+            <dependency>
+                <groupId>org.apache.camel</groupId>
+                <artifactId>camel-bom</artifactId>
+                <version>${camel.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-main</artifactId>
+        </dependency>
+        <!-- we use the endpoint-dsl -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-endpointdsl</artifactId>
+        </dependency>
+        <!-- we use these 2 camel components in this example -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-bean</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-aws2-s3</artifactId>
+        </dependency>
+
+        <!-- logging -->
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>${logback-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>${logback-version}</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <!-- to run the application -->
+            <plugin>
+                <groupId>org.apache.camel</groupId>
+                <artifactId>camel-maven-plugin</artifactId>
+                <version>${camel.version}</version>
+                <configuration>
+                    <mainClass>org.apache.camel.example.MyApplication</mainClass>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/examples/camel-example-main-endpointdsl-aws2-s3/readme.adoc b/examples/camel-example-main-endpointdsl-aws2-s3/readme.adoc
new file mode 100644
index 0000000..d2584c6
--- /dev/null
+++ b/examples/camel-example-main-endpointdsl-aws2-s3/readme.adoc
@@ -0,0 +1,23 @@
+== Camel Example Main Endpoint DSL
+
+This example shows how to use the endpoint DSL in your Camel routes
+to define endpoints using type safe fluent builders, which are Java methods
+that are compiled.
+
+Notice how you can configure Camel in the `application.properties` file.
+
+=== How to run
+
+You can run this example using
+
+    mvn camel:run   
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyApplication.java b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyApplication.java
new file mode 100644
index 0000000..496b37d
--- /dev/null
+++ b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyApplication.java
@@ -0,0 +1,38 @@
+/*
+ * 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.example;
+
+import org.apache.camel.main.Main;
+
+/**
+ * Main class that boot the Camel application
+ */
+public final class MyApplication {
+
+    private MyApplication() {
+    }
+
+    public static void main(String[] args) throws Exception {
+        // use Camels Main class
+        Main main = new Main();
+        // and add the routes (you can specify multiple classes)
+        main.configure().addRoutesBuilder(MyRouteBuilder.class);
+        // now keep the application running until the JVM is terminated (ctrl + c or sigterm)
+        main.run(args);
+    }
+
+}
diff --git a/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyRouteBuilder.java b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyRouteBuilder.java
new file mode 100644
index 0000000..c1723cc
--- /dev/null
+++ b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyRouteBuilder.java
@@ -0,0 +1,33 @@
+/*
+ * 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.example;
+
+import org.apache.camel.builder.endpoint.EndpointRouteBuilder;
+
+/**
+ * To use the endpoint DSL then we must extend EndpointRouteBuilder instead of RouteBuilder
+ */
+public class MyRouteBuilder extends EndpointRouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        from(aws2S3("camel-kafka-connector").delay(10L).deleteAfterRead(false))
+            .log("Consuming!")
+            .log("${body}");
+    }
+}
diff --git a/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/application.properties b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/application.properties
new file mode 100644
index 0000000..ff89ca4
--- /dev/null
+++ b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/application.properties
@@ -0,0 +1,34 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# to configure camel main
+# here you can configure options on camel main (see MainConfigurationProperties class)
+camel.main.name = MyCoolCamel
+
+# enable tracing
+### camel.main.tracing = true
+
+# you can also configure camel context directly
+# camel.context.shutdown-strategy.shutdown-now-on-timeout = false
+
+# you can configure whether OS environment should override (=2 which is default) or as fallback (=1)
+### camel.component.properties.environment-variable-mode=1
+
+# properties used in the route
+camel.component.aws2-s3.accessKey=AKIAJRUNH7VJCF4GQPCA
+camel.component.aws2-s3.secretKey=07juii2LpoIcilAyJfAPK1Y7BDLuJgSnhjZ4pl9W
+camel.component.aws2-s3.region=eu-west-1
diff --git a/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/logback.xml b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/logback.xml
new file mode 100644
index 0000000..a798d0b
--- /dev/null
+++ b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/logback.xml
@@ -0,0 +1,30 @@
+<?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.
+
+-->
+<configuration>
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <root level="INFO">
+        <appender-ref ref="STDOUT" />
+    </root>
+</configuration>


[camel-examples] 05/05: Regen README

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-examples.git

commit 99e9a9e39fbc6504463cb425cf2747b1e969d14b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Sep 24 14:55:14 2020 +0200

    Regen README
---
 examples/README.adoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/README.adoc b/examples/README.adoc
index 1efc231..619cf11 100644
--- a/examples/README.adoc
+++ b/examples/README.adoc
@@ -11,7 +11,7 @@ View the individual example READMEs for details.
 == Examples
 
 // examples: START
-Number of Examples: 78 (0 deprecated)
+Number of Examples: 79 (0 deprecated)
 
 [width="100%",cols="4,2,4",options="header"]
 |===
@@ -41,6 +41,8 @@ Number of Examples: 78 (0 deprecated)
 
 | link:camel-example-main-endpointdsl/readme.adoc[Main Endpointdsl] (camel-example-main-endpointdsl) | Beginner | An example for showing standalone Camel with Endpoint DSL
 
+| link:camel-example-main-endpointdsl-aws2-s3/readme.adoc[Main Endpointdsl Aws2 S3] (camel-example-main-endpointdsl-aws2-s3) | Beginner | An example for showing standalone Camel with Endpoint DSL and AWS2-S3
+
 | link:camel-example-main-health/readme.adoc[Main Health] (camel-example-main-health) | Beginner | An example for showing standalone Camel with Health Checks
 
 | link:camel-example-main-lambda/readme.adoc[Main Lambda] (camel-example-main-lambda) | Beginner | Camel routes lambda style


[camel-examples] 02/05: Added a little example of AWS2-S3 with camel-main and endpoint dsl

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-examples.git

commit 9c7d11bc8ff2d7bdba0ca172de91cd771f9a0cf9
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Sep 24 14:50:32 2020 +0200

    Added a little example of AWS2-S3 with camel-main and endpoint dsl
---
 .../camel-example-main-endpointdsl-aws2-s3/readme.adoc |  4 +++-
 .../java/org/apache/camel/example/MyRouteBuilder.java  |  5 ++---
 .../src/main/resources/application.properties          | 18 +++++-------------
 3 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/examples/camel-example-main-endpointdsl-aws2-s3/readme.adoc b/examples/camel-example-main-endpointdsl-aws2-s3/readme.adoc
index d2584c6..3bf3ba2 100644
--- a/examples/camel-example-main-endpointdsl-aws2-s3/readme.adoc
+++ b/examples/camel-example-main-endpointdsl-aws2-s3/readme.adoc
@@ -1,9 +1,11 @@
-== Camel Example Main Endpoint DSL
+== Camel Example Main Endpoint DSL with AWS2 S3 component
 
 This example shows how to use the endpoint DSL in your Camel routes
 to define endpoints using type safe fluent builders, which are Java methods
 that are compiled.
 
+The example will poll an S3 bucket and Log the content of the file.
+
 Notice how you can configure Camel in the `application.properties` file.
 
 === How to run
diff --git a/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyRouteBuilder.java b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyRouteBuilder.java
index c1723cc..206ea2c 100644
--- a/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyRouteBuilder.java
+++ b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/java/org/apache/camel/example/MyRouteBuilder.java
@@ -26,8 +26,7 @@ public class MyRouteBuilder extends EndpointRouteBuilder {
     @Override
     public void configure() throws Exception {
 
-        from(aws2S3("camel-kafka-connector").delay(10L).deleteAfterRead(false))
-            .log("Consuming!")
-            .log("${body}");
+        from(aws2S3("{{bucketName}}").delay(1000L).deleteAfterRead(false))
+            .log("The content is ${body}");
     }
 }
diff --git a/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/application.properties b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/application.properties
index ff89ca4..77bc0d3 100644
--- a/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/application.properties
+++ b/examples/camel-example-main-endpointdsl-aws2-s3/src/main/resources/application.properties
@@ -17,18 +17,10 @@
 
 # to configure camel main
 # here you can configure options on camel main (see MainConfigurationProperties class)
-camel.main.name = MyCoolCamel
-
-# enable tracing
-### camel.main.tracing = true
-
-# you can also configure camel context directly
-# camel.context.shutdown-strategy.shutdown-now-on-timeout = false
-
-# you can configure whether OS environment should override (=2 which is default) or as fallback (=1)
-### camel.component.properties.environment-variable-mode=1
+camel.main.name = AWS2-S3-Consumer
 
 # properties used in the route
-camel.component.aws2-s3.accessKey=AKIAJRUNH7VJCF4GQPCA
-camel.component.aws2-s3.secretKey=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
-camel.component.aws2-s3.region=eu-west-1
+camel.component.aws2-s3.accessKey=xxxx
+camel.component.aws2-s3.secretKey=yyyy
+camel.component.aws2-s3.region=region
+bucketName=camel