Skip to content

Commit

Permalink
Fix apache#544: regen resources
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaferraro committed Oct 18, 2021
1 parent 106a54b commit 60d1f7b
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/modules/ROOT/assets/images/kamelets/mqtt-sink.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
149 changes: 149 additions & 0 deletions docs/modules/ROOT/pages/mqtt-sink.adoc
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMiIgYmFzZVByb2ZpbGU9InRpbnkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIKCSB5PSIwcHgiIHZpZXdCb3g9IjAgMCAzMjAgMzIwIiBvdmVyZmxvdz0idmlzaWJsZSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnIGlkPSJibGFja19iZyIgZGlzcGxheT0ibm9uZSI+Cgk8cmVjdCBkaXNwbGF5PSJpbmxpbmUiIHdpZHRoPSIzMjAiIGhlaWdodD0iMzIwIi8+CjwvZz4KPGcgaWQ9ImxvZ29zIj4KCTxnPgoJCTxwYXRoIGZpbGw9IiM2NjAwNjYiIGQ9Ik03LjEsMTgwLjZ2MTE3LjFjMCw4LjQsNi44LDE1LjMsMTUuMywxNS4zSDE0MkMxNDEsMjM5LjgsODAuOSwxODAuNyw3LjEsMTgwLjZ6Ii8+CgkJPHBhdGggZmlsbD0iIzY2MDA2NiIgZD0iTTcuMSw4NC4xdjQ5LjhjOTksMC45LDE3OS40LDgwLjcsMTgwLjQsMTc5LjFoNTEuN0MyMzguMiwxODYuNiwxMzQuNSw4NC4yLDcuMSw4NC4xeiIvPgoJCTxwYXRoIGZpbGw9IiM2NjAwNjYiIGQ9Ik0zMTIuOSwyOTcuNlYxOTMuNUMyNzguMSwxMDcuMiwyMDcuMywzOC45LDExOSw3LjFIMjIuNGMtOC40LDAtMTUuMyw2LjgtMTUuMywxNS4zdjE1CgkJCWMxNTIuNiwwLjksMjc2LjYsMTI0LDI3Ny42LDI3NS42aDEzQzMwNi4xLDMxMi45LDMxMi45LDMwNi4xLDMxMi45LDI5Ny42eiIvPgoJCTxwYXRoIGZpbGw9IiM2NjAwNjYiIGQ9Ik0yNzIuNiw0OS44YzE0LjUsMTQuNCwyOC42LDMxLjcsNDAuNCw0Ny44VjIyLjRjMC04LjQtNi44LTE1LjMtMTUuMy0xNS4zaC03Ny4zCgkJCUMyMzguNCwxOS43LDI1Ni42LDMzLjksMjcyLjYsNDkuOHoiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K"
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}}"
19 changes: 19 additions & 0 deletions templates/bindings/camel-k/mqtt-sink-binding.yaml
Original file line number Diff line number Diff line change
@@ -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"

13 changes: 13 additions & 0 deletions templates/bindings/core/mqtt-sink-binding.yaml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 60d1f7b

Please sign in to comment.