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 2022/10/28 08:35:11 UTC

[camel-kamelets] 01/04: Azure Storage Blob Source Kamelet: Add a deleteAfterRead parameter

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

acosentino pushed a commit to branch deleteAfterRead-0.9.x
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit c62a8ed3431e559b5ed42b2f6008fca9fd1a4572
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Oct 28 09:33:03 2022 +0200

    Azure Storage Blob Source Kamelet: Add a deleteAfterRead parameter
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 kamelets/azure-storage-blob-source.kamelet.yaml | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/kamelets/azure-storage-blob-source.kamelet.yaml b/kamelets/azure-storage-blob-source.kamelet.yaml
index e79621bc..278b15b6 100644
--- a/kamelets/azure-storage-blob-source.kamelet.yaml
+++ b/kamelets/azure-storage-blob-source.kamelet.yaml
@@ -66,6 +66,11 @@ spec:
         description: The number of milliseconds before the next poll of the selected blob.
         type: integer
         default: 500
+      deleteAfterRead:
+        title: Auto-delete Blob 
+        description: Specifies to delete blobs after consuming them
+        type: boolean
+        default: false
   dependencies:
     - "camel:azure-storage-blob"
     - "camel:kamelet"
@@ -81,10 +86,15 @@ spec:
         delay: "{{delay}}"
       steps:
         - to: "kamelet:sink"
-        - to:
-            uri: "azure-storage-blob:{{accountName}}/{{containerName}}"
-            parameters:
-              operation: "deleteBlob"
-              accessKey: "{{accessKey}}"
-              credentialType: "{{credentialType}}"
+        - choice:
+            precondition: true
+            when:
+              - simple: '${properties:deleteAfterRead:true}'
+                steps:
+                  - to:
+                      uri: "azure-storage-blob:{{accountName}}/{{containerName}}"
+                      parameters:
+                        operation: "deleteBlob"
+                        accessKey: "{{accessKey}}"
+                        credentialType: "{{credentialType}}"