# emqx_v5_plugin_kafka_bridge **Repository Path**: amespaces/emqx_v5_plugin_kafka_bridge ## Basic Information - **Project Name**: emqx_v5_plugin_kafka_bridge - **Description**: 由于官方的kafka功能是需要收费的,针对开源社区版本的插件功能,实现一套EMQX 转化数据到Kakfa。 目的: 由于数据采集是一套实时系统, 针对温度上报需要做出及时处理, 通过MQTT订阅再处理需要一定时耗, 该项目最后会对数据转化时间做一定压测 - **Primary Language**: Erlang - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2025-06-11 - **Last Updated**: 2026-05-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: rebar3 ## README # emqx_v5_plugin_kafka_bridge This is a template plugin for EMQX >= 5.0. ## Release require: OPT 24+ , rebar3 ```bash make rel ``` - method one Set up the the extenal config file , it is from a fixed path: /etc/emqx_plugin_kafka.conf. The following is an example, mqtt_topics defines the mqtt topics to publish to kafka. ```txt plugin_kafka { bootstrap_hosts = ["10.1.86.192:19092","10.1.86.192:19093", "10.1.86.192:19094"] reconnect_cool_down_seconds = 15 query_api_versions = true topic = "test" mqtt_topics = [ "test/#"] } % explain 1. bootstrap_hosts = ["127.0.0.1:9092"] # kafka address list, multiple addresses are separated 2. reconnect_cool_down_seconds = 15: This line specifies the time in seconds EMQX should wait before attempting to reconnect to Kafka after a disconnection. It is set to 15 seconds here. 3. topic = "test" : kafka topic 4. mqtt_topics - method two set up kafka configuration in env file ```txt export KAFKA_BOOTSTRAP_HOSTS=192.168.1.1:9092 # kafka address list, multiple addresses are separated by commas export KAFKA_TOPIC=test export KAFKA_QUERY_API_VERSIONS=true export KAFKA_RECONNECT_COOL_DOWN_SECONDS=10 export KAFKA_MQTT_TOPICS=/data/#,/data2/# ``` > [!Note]: > * If you are using docker, you need to use -e to specify the env variables or mount the extenal config file to the container. > Copyright [SimingWong <376210268@qq.com>] [name of copyright owner] SPDX-License-Identifier: Apache-2.0 Modification The following changes have been made to this project: - modify kafka_config - modify the payload sent to kafka These modifications were made by amespaces@163.com on 2025-06-11.