Skip to main content



      Home
Home » Eclipse Projects » Paho » How can I fetch stored messages using javascript or PHP(How can I fetch stored messages using javascript or PHP)
How can I fetch stored messages using javascript or PHP [message #1780263] Fri, 19 January 2018 07:08 Go to next message
Eclipse UserFriend
Hi,

We are stored user conversations at location :

/var/lib/mosquitto/mosquitto.db.

So how can I fetch and print those messages using javascript or PHP?

my code:

var client = new Paho.MQTT.Client(host, port, "myClientId" + new Date().getTime());
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
client.onMessageDelivered = onMessageDelivered;
function doFail(responseObject) {
console.log("Connection failed"+responseObject.errorMessage);
}
function onConnect() {
console.log("Connected");
}
function onConnectionLost(responseObject) {
if (responseObject.errorCode !== 0) {
console.log("onConnectionLost:"+responseObject.errorMessage);
}
}
function onMessageArrived(message) {
console.log(message);
}



Thanks
Srinivas
Re: How can I fetch stored messages using javascript or PHP [message #1780862 is a reply to message #1780263] Mon, 29 January 2018 06:04 Go to previous message
Eclipse UserFriend
If you want to read the Mosquitto database directly, that is a Mosquitto question as to how that database is formatted.
Previous Topic:Constant disconnect because of Connection refused - incorrect protocol version
Next Topic:Publishing Paho mqtt
Goto Forum:
  


Current Time: Thu Jun 12 15:45:15 EDT 2025

Powered by FUDForum. Page generated in 0.05017 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top