Skills2026年4月13日·1 分钟阅读

EMQX — Scalable MQTT Broker for IoT and Connected Devices

EMQX is the most scalable open-source MQTT message broker. It handles 100 million+ concurrent connections with millisecond latency, powering IoT platforms, connected vehicles, industrial automation, and real-time messaging for smart devices.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
step-1.md
直接安装命令
npx -y tokrepo@latest install 8d172897-3734-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

TL;DR
EMQX is a high-performance open-source MQTT broker that handles massive concurrent connections for IoT platforms.
§01

What it is

EMQX is an open-source MQTT message broker designed for large-scale IoT deployments. It implements MQTT 5.0 and 3.1.1 protocols and is built on the Erlang/OTP platform, which gives it strong concurrency and fault-tolerance characteristics. EMQX powers IoT platforms, connected vehicles, industrial automation, and smart city infrastructure.

The broker targets IoT architects, embedded engineers, and backend teams building systems that need reliable pub/sub messaging at scale. If your application involves thousands to millions of devices publishing telemetry, EMQX is built for that workload.

§02

How it saves time or tokens

EMQX eliminates the need to build custom message routing, device authentication, and connection management for IoT. Instead of stitching together a message queue, a connection pool, and an auth layer, you get a single binary that handles all three. Its rule engine processes and routes messages without writing custom code, and built-in integrations push data to databases and cloud services directly.

§03

How to use

  1. Run EMQX with Docker:
docker run -d --name emqx \
  -p 1883:1883 -p 8083:8083 \
  -p 8084:8084 -p 8883:8883 \
  -p 18083:18083 \
  emqx/emqx:latest
  1. Access the dashboard at http://localhost:18083 with default credentials (admin / public).
  1. Connect an MQTT client to port 1883 and start publishing messages.
  1. Use the rule engine in the dashboard to route messages to databases, webhooks, or cloud services.
§04

Example

import paho.mqtt.client as mqtt

def on_connect(client, userdata, flags, rc):
    print(f'Connected with result code {rc}')
    client.subscribe('sensors/temperature')

def on_message(client, userdata, msg):
    print(f'{msg.topic}: {msg.payload.decode()}')

client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
client.connect('localhost', 1883, 60)
client.loop_forever()

This subscribes to a temperature sensor topic. Any device publishing to sensors/temperature will have its messages printed.

§05

Related on TokRepo

§06

Common pitfalls

  • Default credentials on the dashboard are a security risk. Change the admin password immediately after deployment, especially in production.
  • EMQX clustering requires proper network configuration. Nodes need to discover each other via DNS or static seeds, and firewalls must allow Erlang distribution ports.
  • MQTT QoS 2 (exactly-once delivery) adds significant overhead. Use QoS 0 or 1 unless your application truly requires exactly-once semantics.

常见问题

How many concurrent connections can EMQX handle?+

EMQX is designed to handle millions of concurrent MQTT connections on a single cluster. The exact number depends on hardware, message rates, and QoS levels. Official benchmarks demonstrate 100 million+ connections in clustered configurations.

Does EMQX support MQTT 5.0?+

Yes. EMQX fully implements MQTT 5.0 including shared subscriptions, topic aliases, flow control, message expiry, and user properties. It also supports MQTT 3.1.1 and 3.1 for backward compatibility.

Can EMQX integrate with databases directly?+

Yes. The built-in rule engine can route messages to PostgreSQL, MySQL, MongoDB, ClickHouse, TimescaleDB, and other databases without writing custom bridge code. Configuration is done through the dashboard or API.

Is EMQX free to use?+

EMQX has an open-source edition under the Apache 2.0 license that is free. There is also an Enterprise edition with additional features like advanced clustering, data integration, and commercial support.

How does EMQX compare to Mosquitto?+

Mosquitto is a lightweight single-node MQTT broker suited for small deployments. EMQX is built for horizontal scaling with native clustering, a rule engine, and a dashboard. Choose Mosquitto for embedded use; choose EMQX for production IoT platforms.

引用来源 (3)

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产