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

oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new abf96a856 Fix #2971: declare dropbox-source's delete, and match the 
azure blob container exactly (#2974)
abf96a856 is described below

commit abf96a8564ef5d480b1124a337f97ae94b2c51e7
Author: Andrea Cosentino <[email protected]>
AuthorDate: Mon Aug 24 18:41:26 2026 +0200

    Fix #2971: declare dropbox-source's delete, and match the azure blob 
container exactly (#2974)
    
    dropbox-source deleted every file it consumed with no property controlling
    it and no mention in the description. Declare a deleteAfterRead property
    and gate the dropbox:del step on it. The default is true, not false: the
    Kamelet polls with a timer and keeps no record of what it has read, so
    turning the delete off makes every poll re-deliver the whole folder. The
    behaviour is unchanged; it is now visible in the schema and switchable.
    
    The gate uses {{deleteAfterRead}} rather than ${properties:...} so the
    property counts as used, avoiding another entry in the validator's
    unused-parameter exclusion list.
    
    azure-storage-blob-event-based-source guarded its fetch with
    "subject contains containerName". The Event Grid subject is
    /blobServices/default/containers/<container>/blobs/<path>, and <path> is
    chosen by the uploader, so the guard also matched on the blob path and on
    containers whose name merely has the configured one as a prefix. Match the
    container segment exactly instead.
    
    Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
---
 .../azure-storage-blob-event-based-source.kamelet.yaml     |  2 +-
 kamelets/dropbox-source.kamelet.yaml                       | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/kamelets/azure-storage-blob-event-based-source.kamelet.yaml 
b/kamelets/azure-storage-blob-event-based-source.kamelet.yaml
index da76bc072..3f340c129 100644
--- a/kamelets/azure-storage-blob-event-based-source.kamelet.yaml
+++ b/kamelets/azure-storage-blob-event-based-source.kamelet.yaml
@@ -152,7 +152,7 @@ spec:
                   - log: "${exchangeProperty.azure-storage-blob-event-type} - 
${exchangeProperty.azure-storage-blob-subject} - 
${exchangeProperty.azure-storage-blob-blob-name}"
                   - choice:
                       when:
-                        - simple: 
'${exchangeProperty.azure-storage-blob-event-type} == 
"Microsoft.Storage.BlobCreated" && 
${exchangeProperty.azure-storage-blob-subject} contains "{{containerName}}"'
+                        - simple: 
'${exchangeProperty.azure-storage-blob-event-type} == 
"Microsoft.Storage.BlobCreated" && 
${exchangeProperty.azure-storage-blob-subject} startsWith 
"/blobServices/default/containers/{{containerName}}/blobs/"'
                           steps:
                             - toD: >-
                                 
azure-storage-blob:{{accountName}}/{{containerName}}?accessKey=RAW({{?accessKey}})&azureClientId=RAW({{?clientId}})&azureClientSecret=RAW({{?clientSecret}})&azureTenantId=RAW({{?tenantId}})&operation=getBlob&blobName=${exchangeProperty.azure-storage-blob-blob-name}&credentialType={{credentialType}}
diff --git a/kamelets/dropbox-source.kamelet.yaml 
b/kamelets/dropbox-source.kamelet.yaml
index 7cef6df9c..98907bee4 100644
--- a/kamelets/dropbox-source.kamelet.yaml
+++ b/kamelets/dropbox-source.kamelet.yaml
@@ -61,6 +61,14 @@ spec:
         title: Remote Path
         description: Original file or folder to work with
         type: string
+      deleteAfterRead:
+        title: Auto-delete File
+        description: Delete each file from Dropbox after it has been consumed. 
This
+          Kamelet polls with a timer and keeps no record of what it has 
already read,
+          so turning this off makes every poll re-deliver the whole folder 
unless you
+          add your own idempotency.
+        type: boolean
+        default: true
       query:
         title: Queries
         description: A space-separated list of sub-strings to search for. A 
file matches only if it contains all the sub-strings. If this option is not 
set, all files is matched.
@@ -92,5 +100,9 @@ spec:
               simple: ${body.metadata.pathDisplay}
           - toD: 
"dropbox:get?accessToken={{accessToken}}&clientIdentifier={{clientIdentifier}}&remotePath=${exchangeProperty.dropboxFileName}"
           - to: "kamelet:sink"
-          - toD: 
"dropbox:del?accessToken={{accessToken}}&clientIdentifier={{clientIdentifier}}&remotePath=${exchangeProperty.dropboxFileName}"
+          - choice:
+              when:
+                - simple: '{{deleteAfterRead}}'
+                  steps:
+                    - toD: 
"dropbox:del?accessToken={{accessToken}}&clientIdentifier={{clientIdentifier}}&remotePath=${exchangeProperty.dropboxFileName}"
 

Reply via email to