This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kamelets-examples.git
The following commit(s) were added to refs/heads/main by this push: new 9d910e0 Added an Azure Storage Blob Append Sink Kamelet example 9d910e0 is described below commit 9d910e03ef3c2afaf3e73bd1a8e12a64609c90df Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon Nov 6 18:15:42 2023 +0100 Added an Azure Storage Blob Append Sink Kamelet example Signed-off-by: Andrea Cosentino <anco...@gmail.com> --- jbang/azure-storage-blob-append/README.adoc | 76 ++++++++++++++++++++++ .../application.properties | 3 + .../timer-append-blob.yaml | 34 ++++++++++ 3 files changed, 113 insertions(+) diff --git a/jbang/azure-storage-blob-append/README.adoc b/jbang/azure-storage-blob-append/README.adoc new file mode 100644 index 0000000..cd19ff5 --- /dev/null +++ b/jbang/azure-storage-blob-append/README.adoc @@ -0,0 +1,76 @@ +== Timer to Azure Storage Blob Sink + +In this sample you'll use the Azure Storage Blob Append Sink Kamelet based on camel-azure-storage-blob component. + +=== Install JBang + +First install JBang according to https://www.jbang.dev + +When JBang is installed then you should be able to run from a shell: + +[source,sh] +---- +$ jbang --version +---- + +This will output the version of JBang. + +To run this example you can either install Camel on JBang via: + +[source,sh] +---- +$ jbang app install camel@apache/camel +---- + +Which allows to run CamelJBang with `camel` as shown below. + +=== Setup credentials + +In the `application.properties` add the correct accessKey, accountName and containerName for the Azure Storage Blob account. + +=== How to run + +Then you can run this example using: + +[source,sh] +---- +$ camel run --local-kamelet-dir=<local-kamelets-dir> timer-append-blob.yaml +---- + +Replace the local kamelet dir with your local directory. + +Or run with JBang using the longer command line (without installing camel as app in JBang): + +[source,sh] +---- +$ jbang run camel@apache/camel run --local-kamelet-dir=<local-kamelets-dir> timer-append-blob.yaml +---- + +Replace the local kamelet dir with your local directory. + + +=== Developer Web Console + +You can enable the developer console via `--console` flag as show: + +[source,sh] +---- +$ jbang run --fresh camel@apache/camel run --local-kamelet-dir=<path_to_local_kamelet_dir> timer-append-blob.yaml --console +---- + +Then you can browse: http://localhost:8080/q/dev to introspect the running Camel applicaton. + + +=== Verify the sink worked + +After a while you should find different files with different name and date. Each of these file will contain two entries (one every 30 seconds). + +=== Help and contributions + +If you hit any problem using Camel or have some feedback, then please +https://camel.apache.org/community/support/[let us know]. + +We also love contributors, so +https://camel.apache.org/community/contributing/[get involved] :-) + +The Camel riders! diff --git a/jbang/azure-storage-blob-append/application.properties b/jbang/azure-storage-blob-append/application.properties new file mode 100644 index 0000000..8b639ef --- /dev/null +++ b/jbang/azure-storage-blob-append/application.properties @@ -0,0 +1,3 @@ +accessKey=<accessKey> +accountName=<accountName> +containerName=<containerName> diff --git a/jbang/azure-storage-blob-append/timer-append-blob.yaml b/jbang/azure-storage-blob-append/timer-append-blob.yaml new file mode 100644 index 0000000..aa98d63 --- /dev/null +++ b/jbang/azure-storage-blob-append/timer-append-blob.yaml @@ -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. +## --------------------------------------------------------------------------- + +- route: + from: + uri: "kamelet:timer-source" + parameters: + message: '{"id":"1","message":"Camel Rocks"}' + contentType: "application/json" + period: 30000 + steps: + - setHeader: + name: file + simple: "append-${date:now:yyyyMMddHHmm}.txt" + - to: + uri: "kamelet:azure-storage-blob-append-sink" + parameters: + accountName: "{{accountName}}" + containerName: "{{containerName}}" + accessKey: "RAW({{accessKey}})"