Closed Viiprogrammer closed 3 weeks ago
@Viiprogrammer That's a retained packet, you should delete it from your broker
@Viiprogrammer That's a retained packet, you should delete it from your broker
Yes, but I didn't created empty packets with retain. In my logs / examples I use clean database, cold start with 1 publish (not empty) + disconnect. After, next connections i still receive that empty packet every connection
@Viiprogrammer Try to change db and you will see you will not receive that message anymore... The message is stored on mongodb retained
@Viiprogrammer Try to change db and you will see you will not receive that message anymore... The message is stored on mongodb retained
Yes, when I clean database not receive, but I didn't understand where from that message.
Every time when I clean DB and connect - zero packet will not receive.
But if I publish anything from server, after disconnect and connect, I receive that package (I don't ever send it)
https://github.com/moscajs/aedes/assets/17622604/70301d75-b7c3-4b63-abdf-1f1ba597e821
Or you suggest replace MongoDB adapters with other (Redis and etc.), MongoDB is not recommended?
@Viiprogrammer checkl the aedes code you wrote above:
server.listen(port, '0.0.0.0', function () {
console.log('Aedes listening on port:', port)
setInterval(() => aedes.publish({
topic: 'test', payload: JSON.stringify({ a: 1, b: ++counter }),
retain: true,
qos: 2
}), 10000)
})
This interval publishes that message, remove that and you will not see it anymore.
My server code:
My client code:
When I start the client and connect + subscribe to the
test
topic (having previously created a session with clear: false), every time I connect, I receive 1 extra packet with an empty buffer.I don't know why that happens. It doesn't seem to be "Last Will and Testament" package, because if I configure
will
in the client, I receive the Last Will and Testament along with this empty packet.Also, same packet (empty) I receive with application MQTTX