All Projects → kaiwaehner → kafka-connect-iot-mqtt-connector-example

kaiwaehner / kafka-connect-iot-mqtt-connector-example

Licence: Apache-2.0 License
Internet of Things Integration Example => Apache Kafka + Kafka Connect + MQTT Connector + Sensor Data

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to kafka-connect-iot-mqtt-connector-example

Hivemq Mqtt Tensorflow Kafka Realtime Iot Machine Learning Training Inference
Real Time Big Data / IoT Machine Learning (Model Training and Inference) with HiveMQ (MQTT), TensorFlow IO and Apache Kafka - no additional data store like S3, HDFS or Spark required
Stars: ✭ 204 (+20%)
Mutual labels:  mqtt, confluent, kafka-connect
Ksql Udf Deep Learning Mqtt Iot
Deep Learning UDF for KSQL for Streaming Anomaly Detection of MQTT IoT Sensor Data
Stars: ✭ 219 (+28.82%)
Mutual labels:  mqtt, confluent, kafka-connect
kotori
A flexible data historian based on InfluxDB, Grafana, MQTT and more. Free, open, simple.
Stars: ✭ 73 (-57.06%)
Mutual labels:  mqtt, internet-of-things, mosquitto
kafka-connect-fs
Kafka Connect FileSystem Connector
Stars: ✭ 107 (-37.06%)
Mutual labels:  confluent, kafka-connect, kafka-connector
zmosq
MQTT/Mosquitto / ZeroMQ proxy
Stars: ✭ 22 (-87.06%)
Mutual labels:  mqtt, mqtt-broker, mosquitto
oracdc
Oracle database CDC (Change Data Capture)
Stars: ✭ 51 (-70%)
Mutual labels:  kafka-connect, confluent-kafka, confluent-platform
Freedomotic
Open IoT Framework
Stars: ✭ 354 (+108.24%)
Mutual labels:  mqtt, opensource, internet-of-things
Iot Harbor
reactor3实现的mqtt库
Stars: ✭ 234 (+37.65%)
Mutual labels:  mqtt, mqtt-broker
Mosquitto Cluster
a built-in, autonomous Mosquitto Cluster implementation. MQTT集群.
Stars: ✭ 238 (+40%)
Mutual labels:  mqtt, mqtt-broker
avro-serde-php
Avro Serialisation/Deserialisation (SerDe) library for PHP 7.3+ & 8.0 with a Symfony Serializer integration
Stars: ✭ 43 (-74.71%)
Mutual labels:  confluent, confluent-platform
tutorials.IoT-over-MQTT
📙 FIWARE 203: Provisioning Ultralight with an alternative transport: IoT over MQTT
Stars: ✭ 49 (-71.18%)
Mutual labels:  mqtt, mqtt-broker
Pjon
PJON (Padded Jittering Operative Network) is an experimental, arduino-compatible, multi-master, multi-media network protocol.
Stars: ✭ 2,615 (+1438.24%)
Mutual labels:  mqtt, internet-of-things
Blynk Server
Blynk is an Internet of Things Platform aimed to simplify building mobile and web applications for the Internet of Things. Easily connect 400+ hardware models like Arduino, ESP8266, ESP32, Raspberry Pi and similar MCUs and drag-n-drop IOT mobile apps for iOS and Android in 5 minutes
Stars: ✭ 8 (-95.29%)
Mutual labels:  mqtt, internet-of-things
kafka-connect-cosmosdb
Kafka Connect connectors for Azure Cosmos DB
Stars: ✭ 28 (-83.53%)
Mutual labels:  kafka-connect, kafka-connector
sol
Lightweight MQTT broker, written from scratch. IO is handled by a super simple event loop based upon the most common IO multiplexing implementations.
Stars: ✭ 72 (-57.65%)
Mutual labels:  mqtt, mqtt-broker
kafka-connect-jenkins
Kafka Connect Connector for Jenkins Open Source Continuous Integration Tool
Stars: ✭ 29 (-82.94%)
Mutual labels:  kafka-connect, kafka-connector
ccu-addon-mosquitto
Mosquitto packaged as Addon for the Homematic CCU3 and RaspberryMatic
Stars: ✭ 23 (-86.47%)
Mutual labels:  mqtt, mosquitto
server
MyController 2.x server
Stars: ✭ 14 (-91.76%)
Mutual labels:  mqtt, internet-of-things
channels-asgi-mqtt
Interface between MQTT and ASGI and Channels 2.0 compatible
Stars: ✭ 36 (-78.82%)
Mutual labels:  mqtt, mqtt-broker
Paho.mqtt.android
MQTT Android
Stars: ✭ 2,334 (+1272.94%)
Mutual labels:  mqtt, internet-of-things

Apache Kafka + Kafka Connect + MQTT Connector + Sensor Data

This demo shows an Internet of Things (IoT) integration example using Apache Kafka + Kafka Connect + MQTT Connector + Sensor Data.

This project does not include any source code as Kafka Connect allows integration with data sources and sinks just with configuration.

Example configuration and step-by-step guide can be found below. If you want to find more details about Kafka + MQTT integration, take a look at my slides from Kafka Summit 2018 in San Francisco: IoT Integration with MQTT and Apache Kafka. The video recording is available on the website of Kafka Summit for free: Kafka MQTT Integration - Video Recording.

Architecture: Sensor Data via MQTT Broker and Kafka Connect MQTT Connector to Kafka Cluster

This project focuses on the integration of MQTT sensor data into Kafka via MQTT Broker and Kafka Connect for further processing:

As alternative to using Kafka Connect, you can also leverage Confluent MQTT Proxy to integrate IoT data from IoT devices directly withou the need for a MQTT Broker. See Deep Learning UDF for KSQL for Streaming Anomaly Detection of MQTT IoT Sensor Data for an example and source code.

If you want to see the other part (integration with sink applications like Elasticsearch / Grafana), please take a look at the project "KSQL for streaming IoT data", which shows how to realize the integration with ElasticSearch via Kafka Connect.

Live Demo Video - MQTT with Kafka Connect and MQTT Proxy

If you want to see Apache Kafka / MQTT integration in a video, please check out the following 15min recording showing a demo my two Github examples:

Apache Kafka + MQTT Integration

Kafka Connect Configuration (No Source Code Needed!)

Here is the full configuration for the MQTT Connector for Kafka Connect's Standalone mode, which we use with Confluent CLI for a local setup:

            name=MqttSourceConnector1
            connector.class=io.confluent.connect.mqtt.MqttSourceConnector
            tasks.max=1
            mqtt.server.uri=< Required Configuration >
            mqtt.topics=< Required Configuration >

For distributed mode, you can use the same configuration with REST API:

            curl -s -X POST -H 'Content-Type: application/json' http://localhost:8083/connectors -d '{
                "name" : "< Required Configuration >",
            "config" : {
                "connector.class" : "io.confluent.connect.mqtt.MqttSourceConnector",
                "tasks.max" : "1",
                "mqtt.server.uri" : "< Required Configuration >",
                "mqtt.topics" : "< Required Configuration >",
                "kafka.topics" : "< Required Configuration >"
            }
            }'

The documentation explains the differences between standalone and distributed Kafka Connect mode. In short: Standalone mode is the simplest mode, where a single process is responsible for executing all connectors and tasks. Distributed mode is used in most production scenarios and provides scalability and automatic fault tolerance for Kafka Connect. You can also use distributed mode for local development leveraging its advantages like a REST API even if you just have one single Connect instance (and you can scale it later easily without complex changes). We will use distributed mode in this project therefore.

Confluent documentation contains more details about installing and using Confluent's MQTT Connector.

How to run it?

Requirements

  • Java 8

  • Confluent Platform 5.0+ (Confluent Enterprise if you want to use the Confluent MQTT Proxy, Confluent Open Source if you just want to run the KSQL UDF and send data via kafkacat instead of MQTT)

  • MQTT Client and Broker (this demo uses Mosquitto)

  • Confluent MQTT Connector (a Kafka Connect based connector to send and receive MQTT messages) - Very easy installation via Confluent Hub, just one command:

              confluent-hub install confluentinc/kafka-connect-mqtt:1.2.3
    
  • Optional: MQTT.fx (a nice, simple UI to test MQTT pub/sub; not required - just makes life more comfortable)

The code is developed and tested on Mac and Linux operating systems. As Kafka does not support and work well on Windows, this is not tested at all.

Step-by-step demo

Follow these steps to configure the MQTT Connector, start all components, generate MQTT sensor data and consume it from a Kafka consumer.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].