Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT v5 Source Kamelet #820

Merged
merged 3 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
* xref:mongodb-source.adoc[]
* xref:mqtt-sink.adoc[]
* xref:mqtt-source.adoc[]
* xref:mqtt5-source.adoc[]
* xref:mustache-template-action.adoc[]
* xref:mvel-template-action.adoc[]
* xref:mysql-sink.adoc[]
Expand Down
80 changes: 80 additions & 0 deletions kamelets/mqtt5-source.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: mqtt5-source
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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk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IvPgoJCTxwYXRoIGZpbGw9IiM2NjAwNjYiIGQ9Ik0yNzIuNiw0OS44YzE0LjUsMTQuNCwyOC42LDMxLjcsNDAuNCw0Ny44VjIyLjRjMC04LjQtNi44LTE1LjMtMTUuMy0xNS4zaC03Ny4zCgkJCUMyMzguNCwxOS43LDI1Ni42LDMzLjksMjcyLjYsNDkuOHoiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K"
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "MQTT 5"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "MQTT 5 Source"
description: |-
Allows receiving messages from any endpoint that supports the MQTT v5 protocol, such as a message broker.
required:
- topic
- brokerUrl
type: object
properties:
topic:
title: Topic
description: The topic to subscribe 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"
clientId:
title: Client ID
description: The client ID to use when connecting to the resource
type: string
default: "mqtt-source"
username:
title: Username
description: Username to use when connecting to the MQTT v5 compliant broker
type: string
x-descriptors:
- urn:camel:group:credentials
password:
title: Password
description: Password to use when connecting to the MQTT v5 compliant broker
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
dependencies:
- "camel:paho-mqtt5"
- "camel:kamelet"
template:
from:
uri: paho-mqtt5:{{topic}}
parameters:
brokerUrl: "{{brokerUrl}}"
clientId: "{{clientId}}"
userName: "{{?username}}"
password: "{{?password}}"
steps:
- to: kamelet:sink
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: mqtt5-source
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 5"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "MQTT 5 Source"
description: |-
Allows receiving messages from any endpoint that supports the MQTT v5 protocol, such as a message broker.
required:
- topic
- brokerUrl
type: object
properties:
topic:
title: Topic
description: The topic to subscribe 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"
clientId:
title: Client ID
description: The client ID to use when connecting to the resource
type: string
default: "mqtt-source"
username:
title: Username
description: Username to use when connecting to the MQTT v5 compliant broker
type: string
x-descriptors:
- urn:camel:group:credentials
password:
title: Password
description: Password to use when connecting to the MQTT v5 compliant broker
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
dependencies:
- "camel:paho-mqtt5"
- "camel:kamelet"
template:
from:
uri: paho-mqtt5:{{topic}}
parameters:
brokerUrl: "{{brokerUrl}}"
clientId: "{{clientId}}"
userName: "{{?username}}"
password: "{{?password}}"
steps:
- to: kamelet:sink