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/08/23 16:37:04 UTC
[camel-kamelets] branch main updated: chore(doc) : Add examples for simple-filter-action kamelet (#1589)
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
The following commit(s) were added to refs/heads/main by this push:
new 38d14b66 chore(doc) : Add examples for simple-filter-action kamelet (#1589)
38d14b66 is described below
commit 38d14b66fe21dbd2e10303c78acb56218904695f
Author: Gaƫlle Fournier <ga...@gmail.com>
AuthorDate: Wed Aug 23 18:36:58 2023 +0200
chore(doc) : Add examples for simple-filter-action kamelet (#1589)
---
kamelets/simple-filter-action.kamelet.yaml | 1 +
.../kamelets/simple-filter-action.kamelet.yaml | 1 +
.../camel-k/simple-filter-action-binding.yaml | 24 ++++++++++++++++++++++
.../core/simple-filter-action-binding.yaml | 13 ++++++++++++
4 files changed, 39 insertions(+)
diff --git a/kamelets/simple-filter-action.kamelet.yaml b/kamelets/simple-filter-action.kamelet.yaml
index b74d64e7..7641ea65 100644
--- a/kamelets/simple-filter-action.kamelet.yaml
+++ b/kamelets/simple-filter-action.kamelet.yaml
@@ -38,6 +38,7 @@ spec:
title: Simple Expression
description: A simple expression to apply on the exchange to filter out some exchange
type: string
+ example: "${body} contains 'John'"
type: object
dependencies:
- "camel:core"
diff --git a/library/camel-kamelets/src/main/resources/kamelets/simple-filter-action.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/simple-filter-action.kamelet.yaml
index b74d64e7..7641ea65 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/simple-filter-action.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/simple-filter-action.kamelet.yaml
@@ -38,6 +38,7 @@ spec:
title: Simple Expression
description: A simple expression to apply on the exchange to filter out some exchange
type: string
+ example: "${body} contains 'John'"
type: object
dependencies:
- "camel:core"
diff --git a/templates/bindings/camel-k/simple-filter-action-binding.yaml b/templates/bindings/camel-k/simple-filter-action-binding.yaml
new file mode 100644
index 00000000..02b7de61
--- /dev/null
+++ b/templates/bindings/camel-k/simple-filter-action-binding.yaml
@@ -0,0 +1,24 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+ name: simple-filter-action-binding
+spec:
+ source:
+ ref:
+ kind: Kamelet
+ apiVersion: camel.apache.org/v1alpha1
+ name: timer-source
+ properties:
+ message: "Hello John"
+ steps:
+ - ref:
+ kind: Kamelet
+ apiVersion: camel.apache.org/v1alpha1
+ name: simple-filter-action
+ properties:
+ expression: "\\${body} contains 'John'"
+ sink:
+ ref:
+ kind: KafkaTopic
+ apiVersion: kafka.strimzi.io/v1beta1
+ name: my-topic
diff --git a/templates/bindings/core/simple-filter-action-binding.yaml b/templates/bindings/core/simple-filter-action-binding.yaml
new file mode 100644
index 00000000..6fd30ff2
--- /dev/null
+++ b/templates/bindings/core/simple-filter-action-binding.yaml
@@ -0,0 +1,13 @@
+- route:
+ from:
+ uri: "kamelet:timer-source"
+ parameters:
+ period: 1000
+ message: "Hello John"
+ steps:
+ - to:
+ uri: "kamelet:simple-filter-action"
+ parameters:
+ expression: "${body} contains 'John'"
+ - to:
+ uri: "log:info"