No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
kafka @ 4811383


This is an example of Thingsboard with Kafka plugin.

Getting Started

First you can start the containers by docker-compose.

$ docker-compose up -d

# Wait a minute

$ docker-compose ps
                     Name                                    Command               State                                    Ports
thingsboardkafkaexample_db_1                      / cass ...   Up       7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp
thingsboardkafkaexample_kafka_1                            Up>9092/tcp
thingsboardkafkaexample_kafka_zookeeper_1         /bin/sh -c /usr/sbin/sshd  ...   Up>2181/tcp, 22/tcp, 2888/tcp, 3888/tcp
thingsboardkafkaexample_thingsboard-db-schema_1   ./              Exit 0
thingsboardkafkaexample_thingsboard_1             ./             Up>1883/tcp,>5683/tcp,>8080/tcp
thingsboardkafkaexample_zk_1                      / zkSe ...   Up       2181/tcp, 2888/tcp, 3888/tcp

Then you can login to Web UI of Thingsboard with default username and password
Some devices have already registered in Thingsboard, so you can use the device Test Device A1 and the access token A1_TEST_TOKEN.


Next you will configure and activate new Kafka plugin, then you will create and activate new Kafka rule.
Please refer to the following link.

NOTE: Please set correctly Kafka Bootstrap Servers URL as below.

Plugin configuration

Bootstrap Servers:


You will post new telemetry of Test Device A1.

# Prepare consuming on terminal A
$ cd kafka
$ ./
bash-4.3# $KAFKA_HOME/bin/ --topic=test-topic --zookeeper=$ZK
Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].
# Post new telemetry on terminal B
  curl -s -X POST http://$THINGSBOARD_HOST:$THINGSBOARD_PORT/api/v1/$ACCESS_TOKEN/telemetry -H "Content-Type:application/json" -d '{"temp":73.4}'

Finally you can consume temp telemetry!

# terminal A