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:02:47 UTC

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

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

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

commit f1460390ef73ab45774c6d2c9143bdbc2296aeaf
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