Skip to content

MQTT session and topic routing - embeddable in Erlang projects.

License

Notifications You must be signed in to change notification settings

zotonic/mqtt_sessions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e2ea345 · May 31, 2024

History

90 Commits
Jul 24, 2023
Apr 9, 2018
May 31, 2024
May 31, 2024
May 12, 2021
Mar 26, 2018
May 12, 2021
May 12, 2021
Apr 18, 2018
Jul 24, 2023
May 28, 2024

Repository files navigation

Test

MQTT v5 server side sessions and routing

MQTT v5 session and topic routing - embeddable in Erlang projects.

This library handles pools of MQTT sessions. Transports (connections) attach to MQTT sessions to relay packets.

The sessions handles packets, queues, and a user-context state.

Access control and authentication is handled with a runtime module. This module is configured in the mqtt_sessions application env key runtime.

The default and example runtime is src/mqtt_sessions_runtime.erl.

Note that this library does not handle TCP/IP connections. It handles the complete MQTT session logic. Other libraries are used for transporting the MQTT packets to/from external clients.

When a subscription is made to a $SYS topic the subscriber is mapped to the default pool. This makes it possible to share system information between different pools.

TODO

  1. Add protections
  • Max packet size
  • Max memory voor retained
  • Max number of pending messages (drop QoS 0)
  • Max pending acks (flow control)
  • Rate limiting
  1. Add instrumentation
  • Number of sessions
  • Number of connected sessions
  • Number of packets sent / received
  • Connect rate
  • Memory consumption of retained tables
  • Sessions with biggest queues
  • Sessions with largest number of packets