eclipse / paho.mqtt.javascript

paho.mqtt.javascript
Other
1.15k stars 467 forks source link

blank messages are sent but not retained #12

Closed jpwsutton closed 8 years ago

jpwsutton commented 8 years ago

migrated from Bugzilla #475302 status UNCONFIRMED severity normal in component MQTT-JS for 1.2 Reported in version unspecified on platform All Assigned to: Ian Craggs

On 2015-08-18 16:47:35 -0400, Alex Krolick wrote:

Using MQTTWS31.js with Node's Mosca MQTT packages.

Sending a blank string as the message payload with retained=true is fine for connected clients, but the messages don't show up if a new client connects and attempts to read the retained messages.

I am not sure if this is an issue with the client, the Mosca broker or a combination.

On 2015-08-18 17:03:55 -0400, Ian Craggs wrote:

So... in the MQTT 3.1.1 specification, sending a QoS 0 zero length message can be a way of removing a retained message.

"If the Server receives a QoS 0 message with the RETAIN flag set to 1 it MUST discard any message previously retained for that topic. It SHOULD store the new QoS 0 message as the new retained message for that topic, but MAY choose to discard it at any time - if this happens there will be no retained message for that topic"

Is that a factor?