njouanin / hbmqtt

MQTT client/broker using Python asynchronous I/O
MIT License
794 stars 190 forks source link

Implement persistence in broker #17

Open njouanin opened 8 years ago

njouanin commented 8 years ago

Currently, all sessions data managed by a broker are stored in memory. This is a limit for serious use. HBMQTT broker should be able to persist sessions data (while offline). Implementation should be based on the plugin system which would allow to use different persistence engine.

jcea commented 7 years ago

I could try but I don't see how to add new plugin outside of the core code. Seems like I would have to edit the plugin machinery source code. I don't see any kind of code for discovery and dynamic loading.

Also, I see a "sqlite" plugin for persistence. I don't see any kind of documentation about this :-?

njouanin commented 7 years ago

hbmqtt uses python setuptools extension mechanism for implementing plugins. What you have to to is develop the necessary extension_point in the broker for supporting persistnce. Then you can develop an external plugin which will plug to these extension points to persist or load messages (from file, DB, or whatever,...).