How to send a message to particular client directly #781
-
Hi in our IOT case the server might send direct control message to client. Is that possible in Sedes? This is how IBM MQ support it:
One possible solution is that each client subscribe to a topic named by its own client ID, but I don't know if this is a good design. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
You could try to do it as follow: var client = broker.clients['clientId']
var packet = {
qos: 1,
retain: true,
topic: 'my/topic',
payload: 'Hello world'
}
client.publish(packet, cb) |
Beta Was this translation helpful? Give feedback.
-
@timepp can do, please checkout the |
Beta Was this translation helpful? Give feedback.
-
@gnought You right, I fixed my answer |
Beta Was this translation helpful? Give feedback.
-
There is no |
Beta Was this translation helpful? Give feedback.
-
@cybercoder It's there but not typed I think |
Beta Was this translation helpful? Give feedback.
You could try to do it as follow: