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 2023/08/30 07:44:19 UTC

[camel-kamelets] branch minio-sink-like-s3 created (now 4dd2a01b)

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

acosentino pushed a change to branch minio-sink-like-s3
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


      at 4dd2a01b Minio Sink Kamelet: Like we do in S3 add the ability to specify objectName instead of using header

This branch includes the following new commits:

     new 4dd2a01b Minio Sink Kamelet: Like we do in S3 add the ability to specify objectName instead of using header

The 1 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.



[camel-kamelets] 01/01: Minio Sink Kamelet: Like we do in S3 add the ability to specify objectName instead of using header

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

acosentino pushed a commit to branch minio-sink-like-s3
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 4dd2a01bc2f76b118f4f9834829e19ade62fde30
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Aug 30 09:43:32 2023 +0200

    Minio Sink Kamelet: Like we do in S3 add the ability to specify objectName instead of using header
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 kamelets/minio-sink.kamelet.yaml                   | 40 ++++++++++++++--------
 .../resources/kamelets/minio-sink.kamelet.yaml     | 40 ++++++++++++++--------
 2 files changed, 50 insertions(+), 30 deletions(-)

diff --git a/kamelets/minio-sink.kamelet.yaml b/kamelets/minio-sink.kamelet.yaml
index 55da1542..ce33c7e9 100644
--- a/kamelets/minio-sink.kamelet.yaml
+++ b/kamelets/minio-sink.kamelet.yaml
@@ -75,6 +75,10 @@ spec:
         x-descriptors:
         - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
         default: false
+      keyName:
+        title: Key Name
+        description: The key name for saving an element in the bucket.
+        type: string
   dependencies:
     - "camel:core"
     - "camel:minio"
@@ -84,22 +88,27 @@ spec:
       uri: "kamelet:source"
       steps:
       - choice:
+          precondition: true
           when:
-          - simple: "${header[file]}"
-            steps:
-            - set-header:
-                name: CamelMinioObjectName
-                simple: "${header[file]}"
-          - simple: "${header[ce-file]}"
-            steps:
-            - set-header:
-                name: CamelMinioObjectName
-                simple: "${header[ce-file]}"
-          otherwise:
-            steps:
-            - set-header:
-                name: CamelMinioObjectName
-                simple: "${exchangeId}"
+            - simple: '${propertiesExist:!keyName}'
+              steps:
+                - choice:   
+                    when:
+                      - simple: "${header[file]}"
+                        steps:
+                          - set-header:
+                              name: CamelMinioObjectName
+                              simple: "${header[file]}"
+                      - simple: "${header[ce-file]}"
+                        steps:
+                          - set-header:
+                              name: CamelMinioObjectName
+                              simple: "${header[ce-file]}"
+                    otherwise:
+                      steps:
+                        - set-header:
+                            name: CamelMinioObjectName
+                            simple: "${exchangeId}"
       - to:
           uri: "minio:{{bucketName}}"
           parameters:
@@ -107,3 +116,4 @@ spec:
             secretKey: "{{secretKey}}"
             accessKey: "{{accessKey}}"
             endpoint: "{{endpoint}}"
+            keyName: "{{?keyName}}"
diff --git a/library/camel-kamelets/src/main/resources/kamelets/minio-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/minio-sink.kamelet.yaml
index 55da1542..ce33c7e9 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/minio-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/minio-sink.kamelet.yaml
@@ -75,6 +75,10 @@ spec:
         x-descriptors:
         - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
         default: false
+      keyName:
+        title: Key Name
+        description: The key name for saving an element in the bucket.
+        type: string
   dependencies:
     - "camel:core"
     - "camel:minio"
@@ -84,22 +88,27 @@ spec:
       uri: "kamelet:source"
       steps:
       - choice:
+          precondition: true
           when:
-          - simple: "${header[file]}"
-            steps:
-            - set-header:
-                name: CamelMinioObjectName
-                simple: "${header[file]}"
-          - simple: "${header[ce-file]}"
-            steps:
-            - set-header:
-                name: CamelMinioObjectName
-                simple: "${header[ce-file]}"
-          otherwise:
-            steps:
-            - set-header:
-                name: CamelMinioObjectName
-                simple: "${exchangeId}"
+            - simple: '${propertiesExist:!keyName}'
+              steps:
+                - choice:   
+                    when:
+                      - simple: "${header[file]}"
+                        steps:
+                          - set-header:
+                              name: CamelMinioObjectName
+                              simple: "${header[file]}"
+                      - simple: "${header[ce-file]}"
+                        steps:
+                          - set-header:
+                              name: CamelMinioObjectName
+                              simple: "${header[ce-file]}"
+                    otherwise:
+                      steps:
+                        - set-header:
+                            name: CamelMinioObjectName
+                            simple: "${exchangeId}"
       - to:
           uri: "minio:{{bucketName}}"
           parameters:
@@ -107,3 +116,4 @@ spec:
             secretKey: "{{secretKey}}"
             accessKey: "{{accessKey}}"
             endpoint: "{{endpoint}}"
+            keyName: "{{?keyName}}"