Giter Club home page Giter Club logo

emqttd_plugin_kafka_bridge's Introduction

emqttd_plugin_kafka_bridge

Emqttd kafka bridge Plugin, a bridge transfer messages from emqtt to kafka.

Build Plugin

Add the plugin as submodule of emqttd project.

If the submodules exist:

git submodule update --remote plugins/emqttd_plugin_kafka_bridge

Orelse:

git submodule add https://github.com/vowstar/emqttd_plugin_kafka_bridge.git plugins/emqttd_plugin_kafka_bridge

And then build emqttd project.

Configure Plugin

TODO: Move broker list to here

File: etc/plugin.config

[
  {emqttd_plugin_kafka_bridge, [
  	{kafka, [
      {bootstrap_broker, {"127.0.0.1", 9092} },
      {partition_strategy, strict_round_robin}
    ]}
  ]}
].

Broker URL and port setting:

bootstrap_broker, {"127.0.0.1", 9092}

Partition strategy setting:

Round robin

partition_strategy, strict_round_robin

Random

partition_strategy, random

Load Plugin

./bin/emqttd_ctl plugins load emqttd_plugin_kafka_bridge

Kafka Topic and messages

Topic

All message will be published on to kafka's broker_message Topic.

Messages

In the following circumstances, you will receive kafka messages

  • when a client connected broker

  • when a client disconnected broker

  • when a client subscribed a channel

  • when a client unsubscribed a channel

  • when a client published a message to a channel

  • when a client delivered a message

  • when a client acknowledged a messages

All these message will published on to kafka.

Connected

{
	"type":"connected",
	"client_id":"a client id",
	"cluster_node":"which emqtt node",
	"ts":1469690427
}

Note: key "ts" is unix timestamp.

Disconnected

{
	"type":"disconnected",
	"client_id":"a client id",
	"reason":"reason why disconnected",
	"cluster_node":"which emqtt node",
	"ts":1469690427
}

Subscribed

{
	"type":"subscribed",
	"client_id":"a client id",
	"topic":"which topic",
	"cluster_node":"which emqtt node",
	"ts":1469690427
}

Unsubscribed

{
	"type":"unsubscribed",
	"client_id":"a client id",
	"topic":"which topic",
	"cluster_node":"which emqtt node",
	"ts":1469690427
}

Published

{
	"type":"published",
	"client_id":"a client id",
	"topic":"which topic",
    "payload":"payload of message",
    "qos":1,
	"cluster_node":"which emqtt node",
	"ts":1469690427
}

Note: key "Qos" is QoS level of message.

Delivered

{
	"type":"delivered",
	"client_id":"a client id",
	"form":"from client id",
	"topic":"which topic",
    "payload":"payload of message",
    "qos":1,
	"cluster_node":"which emqtt node",
	"ts":1469690427
}

Acknowledged

{
	"type":"acked",
	"client_id":"a client id",
	"form":"from client id",
	"topic":"which topic",
    "payload":"payload of message",
    "qos":1,
	"cluster_node":"which emqtt node",
	"ts":1469690427
}

Author

Huang Rui [email protected]

https://www.devicexx.com

Thanks

This project is based on the code of:

Erlang MQTT Broker EMQTTD

Helpshift Ekaf ekaf

And learn ideas form:

Gao dongchen's emqttd_plugin_blackhole

Abhishek Chawla's emqttd_publish_client_activity

emqttd_plugin_kafka_bridge's People

Contributors

vowstar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.