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/09/13 04:22:20 UTC
[camel-kamelets] 02/02: Sync kamelets in Java library
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit 379bc7845f4dd42211177f8d366b737282d7ba78
Author: nicolaferraro <ni...@gmail.com>
AuthorDate: Fri Sep 10 18:38:24 2021 +0200
Sync kamelets in Java library
---
.../kamelets/has-header-filter-action.kamelet.yaml | 26 ++++++++++++++++++----
.../kamelets/kafka-not-secured-source.kamelet.yaml | 6 +++++
.../resources/kamelets/kafka-source.kamelet.yaml | 6 +++++
.../kamelets/telegram-source.kamelet.yaml | 5 +++++
4 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/library/camel-kamelets/src/main/resources/kamelets/has-header-filter-action.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/has-header-filter-action.kamelet.yaml
index 918bbe1..8239492 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/has-header-filter-action.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/has-header-filter-action.kamelet.yaml
@@ -22,6 +22,11 @@ spec:
description: The header name to evaluate
type: string
example: headerName
+ value:
+ title: Header Value
+ description: An optional header value to compare the header to
+ type: string
+ example: headerValue
type: object
dependencies:
- "camel:core"
@@ -30,7 +35,20 @@ spec:
from:
uri: kamelet:source
steps:
- - filter:
- simple: "${header[{{name}}]} == null"
- steps:
- - stop: {}
+ - set-property:
+ name: hasHeaderFilterActionValue
+ constant: "{{value:}}"
+ - choice:
+ when:
+ - simple: "${exchangeProperty[hasHeaderFilterActionValue]} != ''"
+ steps:
+ - filter:
+ simple: "${header[{{name}}]} != ${exchangeProperty[hasHeaderFilterActionValue]}"
+ steps:
+ - stop: {}
+ otherwise:
+ steps:
+ - filter:
+ simple: "${header[{{name}}]} == null"
+ steps:
+ - stop: {}
diff --git a/library/camel-kamelets/src/main/resources/kamelets/kafka-not-secured-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/kafka-not-secured-source.kamelet.yaml
index 5d550d8..e257e57 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/kafka-not-secured-source.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/kafka-not-secured-source.kamelet.yaml
@@ -52,6 +52,11 @@ spec:
description: What to do when there is no initial offset. There are 3 enums and the value can be one of latest, earliest, none
type: string
default: "latest"
+ consumerGroup:
+ title: Consumer Group
+ description: A string that uniquely identifies the group of consumers to which this source belongs
+ type: string
+ example: "my-group-id"
dependencies:
- "camel:kafka"
- "camel:kamelet"
@@ -64,5 +69,6 @@ spec:
allowManualCommit: "{{allowManualCommit}}"
pollOnError: "{{pollOnError}}"
autoOffsetReset: "{{autoOffsetReset}}"
+ groupId: "{{?consumerGroup}}"
steps:
- to: "kamelet:sink"
diff --git a/library/camel-kamelets/src/main/resources/kamelets/kafka-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/kafka-source.kamelet.yaml
index b219149..0ed5df0 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/kafka-source.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/kafka-source.kamelet.yaml
@@ -75,6 +75,11 @@ spec:
description: What to do when there is no initial offset. There are 3 enums and the value can be one of latest, earliest, none
type: string
default: "latest"
+ consumerGroup:
+ title: Consumer Group
+ description: A string that uniquely identifies the group of consumers to which this source belongs
+ type: string
+ example: "my-group-id"
dependencies:
- "camel:kafka"
- "camel:kamelet"
@@ -90,5 +95,6 @@ spec:
allowManualCommit: "{{allowManualCommit}}"
pollOnError: "{{pollOnError}}"
autoOffsetReset: "{{autoOffsetReset}}"
+ groupId: "{{?consumerGroup}}"
steps:
- to: "kamelet:sink"
diff --git a/library/camel-kamelets/src/main/resources/kamelets/telegram-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/telegram-source.kamelet.yaml
index 80d45e8..1c6608c 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/telegram-source.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/telegram-source.kamelet.yaml
@@ -17,6 +17,11 @@ spec:
Receive all messages that people send to your Telegram bot.
To create a bot, contact the @botfather account using the Telegram app.
+
+ The source attaches the following headers to the messages:
+
+ - `chat-id` / `ce-chat-id`: the ID of the chat where the message comes from
+
required:
- authorizationToken
type: object