This is an automated email from the ASF dual-hosted git repository. nferraro pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit 253e598bedde3b4e3c9c42f344ca16c311f328ef Author: nicolaferraro <ni.ferr...@gmail.com> AuthorDate: Mon Oct 18 18:37:47 2021 +0200 Fix #544: regen resources --- .../ROOT/assets/images/kamelets/mqtt-sink.svg | 18 +++ docs/modules/ROOT/nav.adoc | 1 + docs/modules/ROOT/pages/mqtt-sink.adoc | 149 +++++++++++++++++++++ .../main/resources/kamelets/mqtt-sink.kamelet.yaml | 43 ++++++ templates/bindings/camel-k/mqtt-sink-binding.yaml | 19 +++ templates/bindings/core/mqtt-sink-binding.yaml | 13 ++ 6 files changed, 243 insertions(+) diff --git a/docs/modules/ROOT/assets/images/kamelets/mqtt-sink.svg b/docs/modules/ROOT/assets/images/kamelets/mqtt-sink.svg new file mode 100644 index 0000000..9cad0a1 --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/mqtt-sink.svg @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.2" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 320 320" overflow="visible" xml:space="preserve"> +<g id="black_bg" display="none"> + <rect display="inline" width="320" height="320"/> +</g> +<g id="logos"> + <g> + <path fill="#660066" d="M7.1,180.6v117.1c0,8.4,6.8,15.3,15.3,15.3H142C141,239.8,80.9,180.7,7.1,180.6z"/> + <path fill="#660066" d="M7.1,84.1v49.8c99,0.9,179.4,80.7,180.4,179.1h51.7C238.2,186.6,134.5,84.2,7.1,84.1z"/> + <path fill="#660066" d="M312.9,297.6V193.5C278.1,107.2,207.3,38.9,119,7.1H22.4c-8.4,0-15.3,6.8-15.3,15.3v15 + c152.6,0.9,276.6,124,277.6,275.6h13C306.1,312.9,312.9,306.1,312.9,297.6z"/> + <path fill="#660066" d="M272.6,49.8c14.5,14.4,28.6,31.7,40.4,47.8V22.4c0-8.4-6.8-15.3-15.3-15.3h-77.3 + C238.4,19.7,256.6,33.9,272.6,49.8z"/> + </g> +</g> +</svg> diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 988035f..cc7b464 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -94,6 +94,7 @@ * xref:ROOT:minio-source.adoc[image:kamelets/minio-source.svg[] Minio Source] * xref:ROOT:mongodb-sink.adoc[image:kamelets/mongodb-sink.svg[] MongoDB Sink] * xref:ROOT:mongodb-source.adoc[image:kamelets/mongodb-source.svg[] MongoDB Source] +* xref:ROOT:mqtt-sink.adoc[image:kamelets/mqtt-sink.svg[] MQTT Sink] * xref:ROOT:mqtt-source.adoc[image:kamelets/mqtt-source.svg[] MQTT Source] * xref:ROOT:mustache-template-action.adoc[image:kamelets/mustache-template-action.svg[] Mustache Template Action] * xref:ROOT:mvel-template-action.adoc[image:kamelets/mvel-template-action.svg[] Mvel Template Action] diff --git a/docs/modules/ROOT/pages/mqtt-sink.adoc b/docs/modules/ROOT/pages/mqtt-sink.adoc new file mode 100644 index 0000000..65afdf9 --- /dev/null +++ b/docs/modules/ROOT/pages/mqtt-sink.adoc @@ -0,0 +1,149 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT + += image:kamelets/mqtt-sink.svg[] MQTT Sink + +*Provided by: "Apache Software Foundation"* + +*Support Level for this Kamelet is: "Preview"* + +Allows sending messages to any endpoint that supports the MQTT protocol, such as a message broker. + +== Configuration Options + +The following table summarizes the configuration options available for the `mqtt-sink` Kamelet: +[width="100%",cols="2,^2,3,^2,^2,^3",options="header"] +|=== +| Property| Name| Description| Type| Default| Example +| *brokerUrl {empty}* *| Broker URL| The URL of the broker where to establish the connection| string| | `"tcp://mosquitto:1883"` +| *topic {empty}* *| Topic| The topic to send messages to| string| | `"mytopic"` +|=== + +NOTE: Fields marked with an asterisk ({empty}*) are mandatory. + + +== Dependencies + +At runtime, the `mqtt-sink Kamelet relies upon the presence of the following dependencies: + +- camel:paho +- camel:kamelet + +== Usage + +This section describes how you can use the `mqtt-sink`. + +=== Knative Sink + +You can use the `mqtt-sink` Kamelet as a Knative sink by binding it to a Knative object. + +.mqtt-sink-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: mqtt-sink-binding +spec: + source: + ref: + kind: Channel + apiVersion: messaging.knative.dev/v1 + name: mychannel + sink: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: mqtt-sink + properties: + brokerUrl: "tcp://mosquitto:1883" + topic: "mytopic" + +---- + +==== *Prerequisite* + +You have xref:latest@camel-k::installation/installation.adoc[Camel K installed] on the cluster. + +==== *Procedure for using the cluster CLI* + +. Save the `mqtt-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration. + +. Run the sink by using the following command: ++ +[source,shell] +---- +kubectl apply -f mqtt-sink-binding.yaml +---- + +==== *Procedure for using the Kamel CLI* + +Configure and run the sink by using the following command: + +[source,shell] +---- +kamel bind channel:mychannel mqtt-sink -p "sink.brokerUrl=tcp://mosquitto:1883" -p "sink.topic=mytopic" +---- + +This command creates the KameletBinding in the current namespace on the cluster. + +=== Kafka Sink + +You can use the `mqtt-sink` Kamelet as a Kafka sink by binding it to a Kafka topic. + +.mqtt-sink-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: mqtt-sink-binding +spec: + source: + ref: + kind: KafkaTopic + apiVersion: kafka.strimzi.io/v1beta1 + name: my-topic + sink: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: mqtt-sink + properties: + brokerUrl: "tcp://mosquitto:1883" + topic: "mytopic" + +---- + +==== *Prerequisites* + +* You've installed https://strimzi.io/[Strimzi]. +* You've created a topic named `my-topic` in the current namespace. +* You have xref:latest@camel-k::installation/installation.adoc[Camel K installed] on the cluster. + +==== *Procedure for using the cluster CLI* + +. Save the `mqtt-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration. + +. Run the sink by using the following command: ++ +[source,shell] +---- +kubectl apply -f mqtt-sink-binding.yaml +---- + +==== *Procedure for using the Kamel CLI* + +Configure and run the sink by using the following command: + +[source,shell] +---- +kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic mqtt-sink -p "sink.brokerUrl=tcp://mosquitto:1883" -p "sink.topic=mytopic" +---- + +This command creates the KameletBinding in the current namespace on the cluster. + +== Kamelet source file + +https://github.com/apache/camel-kamelets/blob/main/mqtt-sink.kamelet.yaml + +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT diff --git a/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml new file mode 100644 index 0000000..e279e74 --- /dev/null +++ b/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml @@ -0,0 +1,43 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: mqtt-sink + annotations: + camel.apache.org/kamelet.support.level: "Preview" + camel.apache.org/catalog.version: "main-SNAPSHOT" + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMiIgYmFzZVByb2ZpbGU9InRpbnkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIKCSB5PSIwcHgiIHZpZXdCb3g9IjAgMCAzMjAgMzIwIiBvdmVyZmxvdz0idmlzaWJsZSIgeG1sOnNwYWNlPSJwcm [...] + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "MQTT" + labels: + camel.apache.org/kamelet.type: "sink" +spec: + definition: + title: "MQTT Sink" + description: |- + Allows sending messages to any endpoint that supports the MQTT protocol, such as a message broker. + required: + - topic + - brokerUrl + type: object + properties: + topic: + title: Topic + description: The topic to send messages to + type: string + example: "mytopic" + brokerUrl: + title: Broker URL + description: The URL of the broker where to establish the connection + type: string + example: "tcp://mosquitto:1883" + dependencies: + - "camel:paho" + - "camel:kamelet" + flow: + from: + uri: kamelet:source + steps: + - to: + uri: paho:{{topic}} + parameters: + brokerUrl: "{{brokerUrl}}" diff --git a/templates/bindings/camel-k/mqtt-sink-binding.yaml b/templates/bindings/camel-k/mqtt-sink-binding.yaml new file mode 100644 index 0000000..84c979a --- /dev/null +++ b/templates/bindings/camel-k/mqtt-sink-binding.yaml @@ -0,0 +1,19 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: mqtt-sink-binding +spec: + source: + ref: + kind: KafkaTopic + apiVersion: kafka.strimzi.io/v1beta1 + name: my-topic + sink: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: mqtt-sink + properties: + brokerUrl: "tcp://mosquitto:1883" + topic: "mytopic" + \ No newline at end of file diff --git a/templates/bindings/core/mqtt-sink-binding.yaml b/templates/bindings/core/mqtt-sink-binding.yaml new file mode 100644 index 0000000..624d343 --- /dev/null +++ b/templates/bindings/core/mqtt-sink-binding.yaml @@ -0,0 +1,13 @@ +- route: + from: + uri: "kamelet:timer-source" + parameters: + period: 1000 + message: "Hello Camel JBang" + steps: + - to: + uri: "kamelet:mqtt-sink" + parameters: + brokerUrl: "tcp://mosquitto:1883" + topic: "mytopic" + \ No newline at end of file