We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a message is sent with QoS of 2, the client object is not passed to the published method. The code below demonstrates this behavior.
published
const AedesPersistence = require('aedes-persistence'); // -- SERVER --------------------------- const server = require('aedes')({ persistence: new AedesPersistence() }); require('net').createServer(server.handle).listen(3000); server.published = (packet, client, cb) => { if (packet.topic === 'hello') { console.log(`QoS ${packet.qos} =>`, client && client.id); // <-- client is null when QoS is 2 } cb(); }; // -- CLIENT --------------------------- const client = require('mqtt').connect({ host: '127.0.0.1', port: '3000', clientId: 'my-client' }); client.once('connect', () => { client.publish('hello', 'world', { qos: 0 }, () => {}); client.publish('hello', 'world', { qos: 1 }, () => {}); client.publish('hello', 'world', { qos: 2 }, () => {}); });
Outputs:
QoS 0 => my-client QoS 1 => my-client QoS 2 => null
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
When a message is sent with QoS of 2, the client object is not passed to the
published
method. The code below demonstrates this behavior.Outputs:
The text was updated successfully, but these errors were encountered: