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

nferraro 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 daeda2f  Regen for commit b6bafb3c2a2dcc2c29e518bab781afa72a38af05
daeda2f is described below

commit daeda2f6a71bbbb38d3317310619c69e30a5cb36
Author: nicolaferraro <[email protected]>
AuthorDate: Thu May 13 11:55:37 2021 +0000

    Regen for commit b6bafb3c2a2dcc2c29e518bab781afa72a38af05
    
    Signed-off-by: GitHub <[email protected]>
---
 .../kamelets/elasticsearch-index-sink.kamelet.yaml | 28 +++++++++++++---------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git 
a/library/camel-kamelets-catalog/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
 
b/library/camel-kamelets-catalog/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
index 41ad431..a961419 100644
--- 
a/library/camel-kamelets-catalog/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
+++ 
b/library/camel-kamelets-catalog/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
@@ -29,9 +29,10 @@ spec:
 
       If the *indexId* parameter is not set and the source of the kamelet 
binding is a Kafka broker, it will take the kafka topic, partition and offset 
of the
       element to generate an automatic ID that warrantees that this element is 
processed only once.
+
+      If the *indexName* parameter is not set and the source of the kamelet 
binding is a Kafka broker, it will take the kafka topic as the indexName.
     required:
       - clusterName
-      - indexName
       - hostAddresses
     type: object
     properties:
@@ -60,6 +61,7 @@ spec:
         description: The name of the index to act against.
         type: string
         example: data
+        default: 'NONE'
       clusterName:
         title: ElasticSearch Cluster Name
         description: Name of the cluster.
@@ -69,7 +71,7 @@ spec:
         title: Index ID
         description: None
         type: string
-        default: "NONE"
+        default: 'NONE'
   types:
     out:
       mediaType: application/json
@@ -97,14 +99,18 @@ spec:
                   - set-header:
                       name: "indexId"
                       simple: "{{indexId}}"
-        - to:
-            uri: "kamelet-reify:elasticsearch-rest:{{clusterName}}"
-            parameters:
-              operation: "INDEX"
-              indexName: "{{indexName}}"
-              hostAddresses: "{{hostAddresses}}"
-              enableSSL: "{{enableSSL}}"
-              user: "{{user}}"
-              password: "{{password}}"
+        - choice:
+            when:
+              - simple: "'{{indexName}}' == 'NONE'"
+                steps:
+                  - set-property:
+                      name: esIndexName
+                      simple: "${header[kafka.TOPIC]}"
+            otherwise:
+              steps:
+                - set-property:
+                    name: esIndexName
+                    simple: "{{indexName}}"
+        - to-d: 
"kamelet-reify:elasticsearch-rest:{{clusterName}}?hostAddresses=RAW({{hostAddresses}})&operation=INDEX&indexName=${exchangeProperty.esIndexName}&enableSSL={{enableSSL}}&user={{user}}&password={{password}}"
         - marshal:
             json: { }

Reply via email to