Public
Edited
Feb 13, 2023
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
{
var client = new Paho.Client(
'test.mosquitto.org',
8091,
'',
"obs_easz_" + parseInt(Math.random() * 100, 10));

function onFailure(e) {
mutable connectionStatus = `Connection to server failed: ${e.errorMessage}`
};
function onSuccess(ctx) {
client.subscribe("test/topic/easz");
var msg = new Paho.Message("Hello" + parseInt(Math.random() * 100, 10));
msg.destinationName = "test/topic/easz";
//message.topic = "";
client.send(msg);
};
client.onMessageArrived = (msg) => {
mutable MessageArrived = { payloadString: msg.payloadString,
topic: msg.topic };
};
client.onConnectionLost = (err) => {
mutable connectionStatus = `Connection to server lost: ${err.errorMessage}`;
};
client.onConnected = (reconnect, URI) => {
mutable connectionStatus = `Connected to server: ${URI}`;
};
client.connect({userName:'rw',
password:'readwrite',
timeout: 5,
useSSL: true,
onSuccess: onSuccess,
onFailure: onFailure});

}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more