Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elasticsearch Kamelets: Moving from Camel-Elasticsearch-Rest to Camel-Elastichsearch - Index Kamelet #1236

Merged
merged 4 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions kamelets/elasticsearch-index-sink.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:

The input data must be formatted in JSON according to the requirements of the index.

If you specify the `certificate` property, you must base64 encode it before you pass it as a parameter.

In the header, you can set the following properties:

- `indexId` / `ce-indexid`: The index ID for ElasticSearch.
Expand Down Expand Up @@ -82,22 +84,27 @@ spec:
description: The name of the ElasticSearch index.
type: string
example: data
certificate:
title: Certificate
description: The Certificate for accessing the Elasticsearch cluster. You must encode this value in base64.
type: string
example: data
types:
out:
mediaType: application/json
mediaType: text/plain
in:
mediaType: application/json
dependencies:
- "camel:core"
- "camel:jackson"
- "camel:kamelet"
- "camel:elasticsearch-rest"
- "camel:elasticsearch"
- "camel:gson"
- "camel:bean"
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}}"
Expand Down Expand Up @@ -128,12 +135,13 @@ spec:
- set-header:
name: "indexName"
simple: "${header[ce-indexname]}"
- unmarshal:
json: {}
- to:
uri: "{{local-es}}:{{clusterName}}"
parameters:
operation: "INDEX"
hostAddresses: "{{hostAddresses}}"
enableSSL: "{{enableSSL}}"
indexName: "{{?indexName}}"
- marshal:
json: { }
certificatePath: "base64:{{?certificate}}"
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:

The input data must be formatted in JSON according to the requirements of the index.

If you specify the `certificate` property, you must base64 encode it before you pass it as a parameter.

In the header, you can set the following properties:

- `indexId` / `ce-indexid`: The index ID for ElasticSearch.
Expand Down Expand Up @@ -82,22 +84,27 @@ spec:
description: The name of the ElasticSearch index.
type: string
example: data
certificate:
title: Certificate
description: The Certificate for accessing the Elasticsearch cluster. You must encode this value in base64.
type: string
example: data
types:
out:
mediaType: application/json
mediaType: text/plain
in:
mediaType: application/json
dependencies:
- "camel:core"
- "camel:jackson"
- "camel:kamelet"
- "camel:elasticsearch-rest"
- "camel:elasticsearch"
- "camel:gson"
- "camel:bean"
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}}"
Expand Down Expand Up @@ -128,12 +135,13 @@ spec:
- set-header:
name: "indexName"
simple: "${header[ce-indexname]}"
- unmarshal:
json: {}
- to:
uri: "{{local-es}}:{{clusterName}}"
parameters:
operation: "INDEX"
hostAddresses: "{{hostAddresses}}"
enableSSL: "{{enableSSL}}"
indexName: "{{?indexName}}"
- marshal:
json: { }
certificatePath: "base64:{{?certificate}}"