Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/navicore/mqtt-kafka

poc listening to mosquitto mqtt broker and writing to kafka
https://github.com/navicore/mqtt-kafka

akka-streams kafka mqtt scala

Last synced: about 1 month ago
JSON representation

poc listening to mosquitto mqtt broker and writing to kafka

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/navicore/mqtt-kafka.svg?branch=master)](https://travis-ci.org/navicore/mqtt-kafka)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4cd60495891a4573b91af11cf69943ef)](https://www.codacy.com/app/navicore/mqtt-kafka?utm_source=github.com&utm_medium=referral&utm_content=navicore/mqtt-kafka&utm_campaign=Badge_Grade)

MQTT Kafka
====

Working Scala Akka Streams example of listening to an MQTT broker via TLS and writing to Kafka with an MQTT QOS callback acknowledging each "AtLeastOnce" MQTT msg as it is written to Kafka.

```console
docker run -d --name my-kafka -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'` --env ADVERTISED_PORT=9092 spotify/kafka
```

```console
sbt assembly && MQTT_URL=ssl://YOUR_HOST:8883 MQTT_TOPIC=test/c/ MQTT_CLIENT_ID=YOUR_CLIENT_ID MQTT_USER=YOUR_USER MQTT_PWD=YOUR_PWD java -jar target/scala-2.12/MqttKafka.jar
```

```console
./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
```