Replies: 1 comment
-
You should use About your code you don't have to add messageId to the packet, just topic, payload, qos and retain flag |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Whenever a client subscribes to a topic , I have to deliver the latest data of the device to the subscribing client. In the following code whenever I use aedes.publish(), immediately after publishing the client gets disconnected. Is there something wrong with my approach ?
` aedes.authorizeSubscribe = async function (client, subscription, callback) {
try {
const splitted = subscription.topic.split('/');
}
catch (err) {
console.log(err);
return callback(new Error(err));
}
}
`
Beta Was this translation helpful? Give feedback.
All reactions