Sorry can't figure how to delete this. I started a new 2.5.2 server and publish callback works. I must have broken it, maybe my authentication code did.
I'm running mosca: 2.3.0, node v6.92, ubuntu 16.04 and wanted to do some work in the service publish callback but it never seems to fire even though the message gets delivered. Here I just published a simple message after mosca is ready but console.log('done! SUPER SIMPLE') never runs. Any ideas?
moserver.on('ready', setup);
function setup() {
console.log('Mosca server is up and running')
console.log('device mqtt running on port '+cfg.port.mqtt)
console.log('browser mqtt over ws port '+cfg.port.ws)
var message = {
topic: '/hello/world',
payload: 'abcde', // or a Buffer
qos: 0, // 0, 1, or 2
retain: false // or true
};
moserver.publish(message, function() {
console.log('done! SUPER SIMPLE');
});
}
Sorry can't figure how to delete this. I started a new 2.5.2 server and publish callback works. I must have broken it, maybe my authentication code did.
I'm running mosca: 2.3.0, node v6.92, ubuntu 16.04 and wanted to do some work in the service publish callback but it never seems to fire even though the message gets delivered. Here I just published a simple message after mosca is ready but console.log('done! SUPER SIMPLE') never runs. Any ideas?