Skip to content

Built-in MQTT Broker ​

Netty-based MQTT Broker included in FastBee open-source edition — no external MQTT server needed.

Features ​

  • Protocol: MQTT 3.1.1
  • Connections: TCP (1883) + WebSocket (8083)
  • QoS: QoS 0, QoS 1
  • Retain Messages: Supported
  • Last Will: Supported
  • Session: Persistent and clean sessions
  • Auth: Product ID + device key

Architecture ​

Key Modules ​

ModuleDescription
MqttConnectCONNECT handling & auth
MqttPublishPUBLISH processing
MqttSubscribeSubscription management
ClientManagerClient connection tracking
SessionManagerSession state
RetainMsgManagerRetained messages

Auth Flow ​

  1. Client sends CONNECT (ClientID=device#, Username=productID, Password=authKey)
  2. Broker validates via AuthService
  3. Session created, registered in ClientManager
  4. CONNACK sent to client

Performance ​

  • Supports thousands of concurrent connections per node
  • Tunable via NettyConfig (IO threads, buffer sizes)
  • Redis-based message decoupling between Broker and business layer

FastBee | fastbee.cn