From 469dbafbd2d0b98783c22dd1f2a212aed7d1fb9d Mon Sep 17 00:00:00 2001 From: Gaelle Fournier Date: Wed, 23 Aug 2023 15:50:33 +0200 Subject: [PATCH] chore(doc) : Add examples for simple-filter-action kamelet --- kamelets/simple-filter-action.kamelet.yaml | 1 + .../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(+) create mode 100644 templates/bindings/camel-k/simple-filter-action-binding.yaml create mode 100644 templates/bindings/core/simple-filter-action-binding.yaml diff --git a/kamelets/simple-filter-action.kamelet.yaml b/kamelets/simple-filter-action.kamelet.yaml index b74d64e72..7641ea653 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 b74d64e72..7641ea653 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 000000000..02b7de618 --- /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 000000000..6fd30ff2f --- /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"