Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:08 Go to next message
Srinivas Pokala is currently offline Srinivas PokalaFriend
Messages: 7
Registered: May 2016
Junior Member
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 11:04 Go to previous message
Ian Craggs is currently offline Ian CraggsFriend
Messages: 68
Registered: March 2013
Member
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: Sun Nov 18 18:37:42 GMT 2018

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

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

Back to the top