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 2021/07/14 14:59:38 UTC

[camel-kamelets] branch es-sink-index created (now 29b1f1c)

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

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


      at 29b1f1c  ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings

This branch includes the following new commits:

     new 3210290  ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
     new ca86b32  ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
     new 034d0db  ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
     new fffea72  ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
     new 32e7bd6  ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
     new 29b1f1c  ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings

The 6 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] 04/06: ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings

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

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

commit fffea7278fd1b4ba71d9bd3b3d671c980a0cfcd0
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jul 14 16:58:02 2021 +0200

    ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
---
 elasticsearch-index-sink.kamelet.yaml | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/elasticsearch-index-sink.kamelet.yaml b/elasticsearch-index-sink.kamelet.yaml
index 04a793d..e4be13c 100644
--- a/elasticsearch-index-sink.kamelet.yaml
+++ b/elasticsearch-index-sink.kamelet.yaml
@@ -73,11 +73,6 @@ spec:
         description: Name of the cluster.
         type: string
         example: quickstart
-      indexId:
-        title: Index ID
-        description: None
-        type: string
-        default: 'NONE'
   types:
     out:
       mediaType: application/json

[camel-kamelets] 03/06: ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings

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

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

commit 034d0dbdb7b3ea27c001485300dc278038a87616
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jul 14 16:55:32 2021 +0200

    ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
---
 docs/modules/ROOT/pages/elasticsearch-index-sink.adoc | 9 +++++----
 docs/modules/ROOT/pages/infinispan-source.adoc        | 7 +++++--
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc b/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc
index 8597c30..b95e3ed 100644
--- a/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc
+++ b/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc
@@ -9,12 +9,13 @@ This sink stores documents into ElasticSearch.
 
 Input data must have JSON format according to the index used.
 
-If the *indexId* parameter is set, that value will be used as the document ID on ElasticSearch.
+- `indexId` / `ce-indexId`: as the index ID for Elasticsearch
 
-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 header won't be set the exchange ID will be used as index.
 
-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.
+- `indexName` / `ce-indexName`: as the index Name for Elasticsearch
+
+If the header won't be set the exchange ID will be used as index name.
 
 == Configuration Options
 
diff --git a/docs/modules/ROOT/pages/infinispan-source.adoc b/docs/modules/ROOT/pages/infinispan-source.adoc
index 101cd7e..98e13c8 100644
--- a/docs/modules/ROOT/pages/infinispan-source.adoc
+++ b/docs/modules/ROOT/pages/infinispan-source.adoc
@@ -13,6 +13,7 @@ The following table summarizes the configuration options available for the `infi
 [width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
 |===
 | Property| Name| Description| Type| Default| Example
+| *cacheName {empty}* *| Cache Name| The name of the Infinispan cache to use| String| | 
 | *hosts {empty}* *| Hosts| Specifies the host of the cache on Infinispan instance| String| | 
 | *password {empty}* *| Password| Password to connect to Infinispan.| string| | 
 | *username {empty}* *| Username| Username to connect to Infinispan.| string| | 
@@ -47,6 +48,7 @@ spec:
       apiVersion: camel.apache.org/v1alpha1
       name: infinispan-source
     properties:
+      cacheName: "The Cache Name"
       hosts: "The Hosts"
       password: "The Password"
       username: "The Username"
@@ -75,7 +77,7 @@ The procedure described above can be simplified into a single execution of the `
 
 [source,shell]
 ----
-kamel bind infinispan-source -p "source.hosts=The Hosts" -p "source.password=The Password" -p "source.username=The Username" channel/mychannel
+kamel bind infinispan-source -p "source.cacheName=The Cache Name" -p "source.hosts=The Hosts" -p "source.password=The Password" -p "source.username=The Username" channel/mychannel
 ----
 
 This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.
@@ -98,6 +100,7 @@ spec:
       apiVersion: camel.apache.org/v1alpha1
       name: infinispan-source
     properties:
+      cacheName: "The Cache Name"
       hosts: "The Hosts"
       password: "The Password"
       username: "The Username"
@@ -127,7 +130,7 @@ The procedure described above can be simplified into a single execution of the `
 
 [source,shell]
 ----
-kamel bind infinispan-source -p "source.hosts=The Hosts" -p "source.password=The Password" -p "source.username=The Username" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
+kamel bind infinispan-source -p "source.cacheName=The Cache Name" -p "source.hosts=The Hosts" -p "source.password=The Password" -p "source.username=The Username" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
 ----
 
 This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

[camel-kamelets] 06/06: ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings

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

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

commit 29b1f1cbac33af585cea3d96588611f9763cc7aa
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jul 14 16:59:01 2021 +0200

    ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
---
 docs/modules/ROOT/pages/elasticsearch-index-sink.adoc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc b/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc
index b95e3ed..96c6407 100644
--- a/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc
+++ b/docs/modules/ROOT/pages/elasticsearch-index-sink.adoc
@@ -26,7 +26,6 @@ The following table summarizes the configuration options available for the `elas
 | *clusterName {empty}* *| ElasticSearch Cluster Name| Name of the cluster.| string| | `"quickstart"`
 | *hostAddresses {empty}* *| Host Addresses| Comma separated list with ip:port formatted remote transport addresses to use.| string| | `"quickstart-es-http:9200"`
 | enableSSL| Enable SSL| Do we want to connect using SSL?| boolean| `true`| 
-| indexId| Index ID| None| string| `"NONE"`| 
 | indexName| Index in ElasticSearch| The name of the index to act against.| string| `"NONE"`| `"data"`
 | password| Password| Password to connect to ElasticSearch.| string| | 
 | user| Username| Username to connect to ElasticSearch.| string| | 

[camel-kamelets] 05/06: ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings

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

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

commit 32e7bd64839decdfdfe3409ffa793ec523a88aaf
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jul 14 16:58:30 2021 +0200

    ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
---
 .../main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml    | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
index 04a793d..e4be13c 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
@@ -73,11 +73,6 @@ spec:
         description: Name of the cluster.
         type: string
         example: quickstart
-      indexId:
-        title: Index ID
-        description: None
-        type: string
-        default: 'NONE'
   types:
     out:
       mediaType: application/json

[camel-kamelets] 01/06: ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings

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

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

commit 321029058cb1e8910d7b53fedb2c88515f1e0bc5
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jul 14 16:53:07 2021 +0200

    ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
---
 elasticsearch-index-sink.kamelet.yaml | 84 ++++++++++++++++++++++-------------
 1 file changed, 53 insertions(+), 31 deletions(-)

diff --git a/elasticsearch-index-sink.kamelet.yaml b/elasticsearch-index-sink.kamelet.yaml
index 2482537..04a793d 100644
--- a/elasticsearch-index-sink.kamelet.yaml
+++ b/elasticsearch-index-sink.kamelet.yaml
@@ -27,12 +27,13 @@ spec:
 
       Input data must have JSON format according to the index used.
 
-      If the *indexId* parameter is set, that value will be used as the document ID on ElasticSearch.
+      - `indexId` / `ce-indexId`: as the index ID for Elasticsearch
 
-      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 header won't be set the exchange ID will be used as index.
 
-      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.
+      - `indexName` / `ce-indexName`: as the index Name for Elasticsearch
+
+      If the header won't be set the exchange ID will be used as index name.
     required:
       - clusterName
       - hostAddresses
@@ -46,6 +47,9 @@ spec:
         title: Password
         description: Password to connect to ElasticSearch.
         type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
       enableSSL:
         title: Enable SSL
         description: Do we want to connect using SSL?
@@ -89,30 +93,48 @@ spec:
     from:
       uri: kamelet:source
       steps:
-        - choice:
-            when:
-              - simple: "'{{indexId}}' == 'NONE' && ${header[kafka.TOPIC]} != null"
-                steps:
-                  - set-header:
-                      name: "indexId"
-                      simple: "${header[kafka.TOPIC]}${header[kafka.PARTITION]}${header[kafka.OFFSET]}"
-              - simple: "'{{indexId}}' != 'NONE'"
-                steps:
-                  - set-header:
-                      name: "indexId"
-                      simple: "{{indexId}}"
-        - 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: { }
+      - choice:
+          when:
+          - simple: "${header[indexId]}"
+            steps:
+            - set-header:
+                name: "indexId"
+                simple: "${header[indexId]}"
+          - simple: "${header[ce-indexId]}"
+            steps:
+            - set-header:
+                name: "indexId"
+                simple: "${header[ce-indexId]}"
+          otherwise:
+            steps:
+            - set-header:
+                name: "indexId"
+                simple: "${exchangeId}"
+      - choice:
+          when:
+          - simple: "${header[indexName]}"
+            steps:
+            - set-header:
+                name: "indexName"
+                simple: "${header[indexName]}"
+          - simple: "${header[ce-indexName]}"
+            steps:
+            - set-header:
+                name: "indexName"
+                simple: "${header[ce-indexName]}"
+          otherwise:
+            steps:
+            - set-header:
+                name: "indexName"
+                simple: "${exchangeId}"
+      - to:
+          uri: "kamelet-reify:elasticsearch-rest:{{clusterName}}"
+          parameters:
+            operation: "INDEX"
+            indexName: "{{indexName}}"
+            hostAddresses: "{{hostAddresses}}"
+            enableSSL: "{{enableSSL}}"
+            user: "{{?user}}"
+            password: "{{?password}}"
+      - marshal:
+          json: { }

[camel-kamelets] 02/06: ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings

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

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

commit ca86b32f64064e8a6aed6a1d8a1d016c5ca284a8
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jul 14 16:54:48 2021 +0200

    ElasticSearch Index Sink: Fixed user/password as optional and fixed the headers settings
---
 .../kamelets/elasticsearch-index-sink.kamelet.yaml | 84 ++++++++++++++--------
 1 file changed, 53 insertions(+), 31 deletions(-)

diff --git a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
index 2482537..04a793d 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml
@@ -27,12 +27,13 @@ spec:
 
       Input data must have JSON format according to the index used.
 
-      If the *indexId* parameter is set, that value will be used as the document ID on ElasticSearch.
+      - `indexId` / `ce-indexId`: as the index ID for Elasticsearch
 
-      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 header won't be set the exchange ID will be used as index.
 
-      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.
+      - `indexName` / `ce-indexName`: as the index Name for Elasticsearch
+
+      If the header won't be set the exchange ID will be used as index name.
     required:
       - clusterName
       - hostAddresses
@@ -46,6 +47,9 @@ spec:
         title: Password
         description: Password to connect to ElasticSearch.
         type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
       enableSSL:
         title: Enable SSL
         description: Do we want to connect using SSL?
@@ -89,30 +93,48 @@ spec:
     from:
       uri: kamelet:source
       steps:
-        - choice:
-            when:
-              - simple: "'{{indexId}}' == 'NONE' && ${header[kafka.TOPIC]} != null"
-                steps:
-                  - set-header:
-                      name: "indexId"
-                      simple: "${header[kafka.TOPIC]}${header[kafka.PARTITION]}${header[kafka.OFFSET]}"
-              - simple: "'{{indexId}}' != 'NONE'"
-                steps:
-                  - set-header:
-                      name: "indexId"
-                      simple: "{{indexId}}"
-        - 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: { }
+      - choice:
+          when:
+          - simple: "${header[indexId]}"
+            steps:
+            - set-header:
+                name: "indexId"
+                simple: "${header[indexId]}"
+          - simple: "${header[ce-indexId]}"
+            steps:
+            - set-header:
+                name: "indexId"
+                simple: "${header[ce-indexId]}"
+          otherwise:
+            steps:
+            - set-header:
+                name: "indexId"
+                simple: "${exchangeId}"
+      - choice:
+          when:
+          - simple: "${header[indexName]}"
+            steps:
+            - set-header:
+                name: "indexName"
+                simple: "${header[indexName]}"
+          - simple: "${header[ce-indexName]}"
+            steps:
+            - set-header:
+                name: "indexName"
+                simple: "${header[ce-indexName]}"
+          otherwise:
+            steps:
+            - set-header:
+                name: "indexName"
+                simple: "${exchangeId}"
+      - to:
+          uri: "kamelet-reify:elasticsearch-rest:{{clusterName}}"
+          parameters:
+            operation: "INDEX"
+            indexName: "{{indexName}}"
+            hostAddresses: "{{hostAddresses}}"
+            enableSSL: "{{enableSSL}}"
+            user: "{{?user}}"
+            password: "{{?password}}"
+      - marshal:
+          json: { }