When to use message vs subscribe callback method to receive published data ? #1785
Answered
by
robertsLando
luan-dang-techlabs
asked this question in
Q&A
-
New to MQTT , trying to understand when you use 'message' callback to receive message vs 'subscribe' method to receive published method.
|
Beta Was this translation helpful? Give feedback.
Answered by
robertsLando
Jan 26, 2024
Replies: 1 comment 1 reply
-
The subscribe callback is called with the subscription result, it tells you if there was an error on subscription or not. The Then there is also the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
robertsLando
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The subscribe callback is called with the subscription result, it tells you if there was an error on subscription or not. The
message
callback is called everytime a message is received.Then there is also the
client.handleMessage(packet, done)
function that can be used to handle messages with backpressure support (the next message that comes is not processed until you calldone
callback.