The mosquitto-auth-plugin uses the database to store username/password and ACL information, not message content.
Writing some code to store messages in a database from any MQTT broker is relatively simple.
There are several approaches:
- You could write a small java/python/nodejs application to do it using one of the MQTT libraries for a given language.
- You could use something like Node-RED to create a flow that will write messages to the database.
- You could use the HiveMQ broker instead of Mosquitto which has a plugin mechanism that supports storing messages in a database.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…