Hi Stefano,
Two different approaches:
- modify the broker so that it saves messages directly to MySQL instead of
the present way (flat file? SQLite? What's today??) PRO: best integration
CON: difficult to be maintained and configured
At the moment the broker only keeps retained messages when it saves to
disk so I doubt that would be sufficient. I do envisage at some point
mosquitto providing an interface that you could get access to this
sort of information direct from the broker without having to develop a
separate app. I've not even considered how that would look though, so
don't hold your breath for it.
- build a separate application that subscribes/publish to the broker and
saves/retrieves to MySQL with standard SQL queries. PRO: extensible and
configurable CON: another application to be maintained
I think you could do it very simply actually, so it's probably less
maintenance than integrating code into the broker. I've got a simple
example of this very thing in the 0.16 branch in examples/mysql_log/