From daeda2f6a71bbbb38d3317310619c69e30a5cb36 Mon Sep 17 00:00:00 2001 From: nicolaferraro Date: Thu, 13 May 2021 11:55:37 +0000 Subject: [PATCH] Regen for commit b6bafb3c2a2dcc2c29e518bab781afa72a38af05 Signed-off-by: GitHub --- .../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 41ad4318c..a9614198c 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: { }