njouanin / hbmqtt

MQTT client/broker using Python asynchronous I/O
MIT License
800 stars 188 forks source link

how to write a broker plugin? Or is that even what I want to do? #243

Open PlanetaryGear opened 3 years ago

PlanetaryGear commented 3 years ago

I would like to get the incoming message information, along with the subscription info and so forth. It seems to me that without this capability running a broker is pointless? Given all that I have read and tested in the code what I want is a plugin that I can use to forward the messages to my own code and handle them properly. I don’t consider myself a python newb but I cannot make the plugin system load any of my code or pass me any messages at all. The plugins that are included do not seem to load either as adding print statements to their init methods yield nothing at all.

Is there some example code somewhere for a plugin that even just prints the path and data to what is received? I could use that to expand to my own code no problem but i cannot find anything at all useful out there. Specifically I would like to intercept the message received events and the subscription received events so that I can update my own endpoints and send messages when they change. That seems like what anyone would want to use an MQTT broker for but I cannot find any info from anyone who has actually done so. I apologize if my google foo is lacking ;) Any guidence or links or suggestions would be greatly appreciated.