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 d45a26513042059217de4f8b1ccf1e68af149ee8
Author: nicolaferraro <ni.ferr...@gmail.com>
AuthorDate: Fri Sep 10 18:37:53 2021 +0200

    Update to Kamelets
---
 has-header-filter-action.kamelet.yaml | 26 ++++++++++++++++++++++----
 kafka-not-secured-source.kamelet.yaml |  6 ++++++
 kafka-source.kamelet.yaml             |  6 ++++++
 telegram-source.kamelet.yaml          |  5 +++++
 4 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/has-header-filter-action.kamelet.yaml 
b/has-header-filter-action.kamelet.yaml
index 918bbe1..8239492 100644
--- a/has-header-filter-action.kamelet.yaml
+++ b/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/kafka-not-secured-source.kamelet.yaml 
b/kafka-not-secured-source.kamelet.yaml
index 5d550d8..e257e57 100644
--- a/kafka-not-secured-source.kamelet.yaml
+++ b/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/kafka-source.kamelet.yaml b/kafka-source.kamelet.yaml
index b219149..0ed5df0 100644
--- a/kafka-source.kamelet.yaml
+++ b/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/telegram-source.kamelet.yaml b/telegram-source.kamelet.yaml
index 80d45e8..1c6608c 100644
--- a/telegram-source.kamelet.yaml
+++ b/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

Reply via email to