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/01/11 13:09:10 UTC

[camel-kamelets] 02/05: Elasticsearch Kamelets: Moving from Camel-Elasticsearch-Rest to Camel-Elastichsearch - Search Kamelet

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

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

commit e4f4ebbfe40e8a84a806e658455d579f678b7344
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jan 11 13:55:22 2023 +0100

    Elasticsearch Kamelets: Moving from Camel-Elasticsearch-Rest to Camel-Elastichsearch - Search Kamelet
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../kamelets/elasticsearch-search-source.kamelet.yaml      | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-search-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-search-source.kamelet.yaml
index 9d853bf3..d98d2d21 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-search-source.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-search-source.kamelet.yaml
@@ -80,6 +80,10 @@ spec:
         title: ElasticSearch Cluster Name
         description: The name of the cluster.
         type: string
+      certificate:
+        title: Certificate 
+        description: The Certificate for accessing the Elasticsearch cluster. You must encode this value in base64.
+        type: string
   types:
     out:
       mediaType: application/json
@@ -87,12 +91,12 @@ spec:
       - "camel:core"
       - "camel:kamelet"
       - "camel:timer"
-      - "camel:elasticsearch-rest"
+      - "camel:elasticsearch"
       - "camel:gson"
   template:
     beans:
       - name: local-es
-        type: "#class:org.apache.camel.component.elasticsearch.ElasticsearchComponent"
+        type: "#class:org.apache.camel.component.es.ElasticsearchComponent"
         properties:
             user: "{{?user}}"
             password: "{{?password}}"
@@ -102,10 +106,7 @@ spec:
         period: "{{period}}"
       steps:
         - set-body:
-            constant: "{{query}}"
-        - set-header:
-            name: "Content-Type"
-            constant: "text/plain"
+            constant: "{{query?nested=false}}"
         - to:
             uri: "{{local-es}}:{{clusterName}}"
             parameters:
@@ -113,6 +114,7 @@ spec:
               indexName: "{{indexName}}"
               hostAddresses: "{{hostAddresses}}"
               enableSSL: "{{enableSSL}}"
+              certificatePath: "base64:{{?certificate}}"
         - marshal:
             json:
               library: Gson