I'm not a good erlang developer, but I have developed some custom modules for my ejabberd service. When developing a module, we need to track MQTT device connections. some times device connects but disconnects for some reason. but we cannot isolate the devices that frequently connection/disconnection happening.
Currently, ejabberd's MQTT implementation lacks event hooks for connection and disconnection events (it may be for performance optimization). Unlike XMPP which provides sm_register_connection_hook and sm_remove_connection_hook, MQTT has no equivalent mechanism for external modules to react to client lifecycle events.
This limitation prevents:
- Real-time user/device tracking and analytics
- Integration with external monitoring systems
- Custom authentication/authorization workflows post-connection
- IoT device provisioning workflows
I'm not a good erlang developer, but I have developed some custom modules for my ejabberd service. When developing a module, we need to track MQTT device connections. some times device connects but disconnects for some reason. but we cannot isolate the devices that frequently connection/disconnection happening.
Currently, ejabberd's MQTT implementation lacks event hooks for connection and disconnection events (it may be for performance optimization). Unlike XMPP which provides sm_register_connection_hook and sm_remove_connection_hook, MQTT has no equivalent mechanism for external modules to react to client lifecycle events.
This limitation prevents: