This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kamelets-examples.git
The following commit(s) were added to refs/heads/main by this push: new 64575a5 Polished 64575a5 is described below commit 64575a5710c760aba54d8b91d78c45a742882abe Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Apr 14 14:44:54 2023 +0200 Polished --- jbang/mqtt/README.adoc | 2 +- jbang/mqtt/mqtt.camel.yaml | 24 +++++++++++++++++++++--- jbang/mqtt/payload-low.json | 3 +++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/jbang/mqtt/README.adoc b/jbang/mqtt/README.adoc index c7686fd..866483b 100644 --- a/jbang/mqtt/README.adoc +++ b/jbang/mqtt/README.adoc @@ -60,7 +60,7 @@ The Camel integration will then consume the payload and output in the console. [source,text] ---- -2023-04-14 08:58:58.676 INFO 62348 --- [calCliConnector] mqtt.yaml:13 : The temperature is 21 +2023-04-14 08:58:58.676 INFO 62348 --- [calCliConnector] mqtt.camel.yaml:27 : Warm temperature at 21 ---- ==== Stopping diff --git a/jbang/mqtt/mqtt.camel.yaml b/jbang/mqtt/mqtt.camel.yaml index aeea498..b0ec0c5 100644 --- a/jbang/mqtt/mqtt.camel.yaml +++ b/jbang/mqtt/mqtt.camel.yaml @@ -13,6 +13,24 @@ jq: expression: .value id: jq-d9d0 - - log: - message: The temperature is ${body} - id: log-ac74 + - convertBodyTo: + type: String + id: convertBodyTo-c5ee + - choice: + when: + - id: when-1bdb + expression: + simple: + expression: ${body} > 20 + id: simple-5f3c + steps: + - log: + message: Warm temperature at ${body} + id: log-04f5 + id: choice-0565 + otherwise: + id: otherwise-2305 + steps: + - log: + message: Cold temperator at ${body} + id: log-dcb6 diff --git a/jbang/mqtt/payload-low.json b/jbang/mqtt/payload-low.json new file mode 100644 index 0000000..63b9a39 --- /dev/null +++ b/jbang/mqtt/payload-low.json @@ -0,0 +1,3 @@ +{ + "value": 7 +} \ No newline at end of file