Question

I am using MQTT.js to create a broker for my new app. For a last few hours I am struggling with passing QoS flag. I can easily pass messageId, dup, retain flags but not QoS. My code is rather simple, on the client (created with MQTT.js) I do:

client.publish({ messageId: 1001, qos: 1, topic: ..., payload: ... });

On the server I am doing the following:

client.on('publish', function(packet) {
  for ( var key in packet ) {
    util.puts(i+'::'+packet[i]);
  }
});

No matter what I set as the QoS on the client I am always getting 0 on the server. I was expecting this to work out of the box. Anyone has any experience with this?

Thank you.

Was it helpful?

Solution

I have found a solution to this problem. The author actually acted quite quickly. The solution is in the following pull request: https://github.com/adamvr/MQTT.js/pull/18

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top