如何读取MQTT mosquitto服务器持久化的DB文件 [英] how to read MQTT mosquitto server persisted DB file

查看:2232
本文介绍了如何读取MQTT mosquitto服务器持久化的DB文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是用于MQTT协议的mosquitto服务器。
使用-c选项的配置文件中的持久性设置,我可以保存数据。
但是生成的文件是二进制文件。
如何读取该文件?



有没有特定的工具可以使用?

感谢您的意见。



谢谢!
Amit

解决方案

为什么你要阅读?

当消息(QOS1或QOS2)在运行时,数据只保存在那里,以确保它们在等待来自订阅客户端的响应时不丢失。



在客户端重新连接之前,数据也可以保留给断开连接但具有持久订阅(cleanSession = false)的客户端。



如果您要保留所有消息以后消费,你将不得不写一个客户端来订阅和存储这个数据在你选择的数据库。一个可能的选择是快速而简单地做Node-RED,但也有其他的一些经纪人甚至为此提供了插件。 HiveMQ。

如果你真的想阅读它,那么你可能必须编写自己的工具来根据Mosquitto src代码来完成这个工作。


I am using mosquitto server for MQTT protocol. Using persistence setting in a configuration file with -c option, I am able to save the data. However the file generated is binary one. How would one be able to read that file?

Is there any specific tool available for that?

Appreciate your views.

Thanks! Amit

解决方案

Why do you want to read it?

The data is only kept there while messages (QOS1 or QOS2) are in flight to ensure they are not lost in transit while waiting for a response from the subscribed client.

Data may also be kept for clients that are disconnected but have persistent subscriptions (cleanSession=false) until that client reconnects.

If you are looking to persist all messages for later consumption you will have to write a client to subscribe and store this data in a DB of your choosing. One possible option to do this quickly and simply is Node-RED, but there are others and some brokers even have plugins for this e.g. HiveMQ.

If you really want to read it then you will probably have to write your own tool to do this based on the Mosquitto src code

这篇关于如何读取MQTT mosquitto服务器持久化的DB文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆