Open khoshbin opened 5 years ago
There isn't at the moment. It is certainly possible to do this from within an Erlang plugin using internal functions, though.
Is there any code sample/documentation in this regard? this is not part of mqtt protocol.But some brokers(like IBM's) have internal api to do this.It is great feature to be added to your feature list
I don't know of any samples for this - you'd have to dig into the code yourself or ask on the community slack if anyone did this already. We'll put the feature on the backlog for future consideration. I'll keep this open for now.
EMQ also has this feature and has been implemented with mod_subscription. In this module we can have:
## Subscribe the Topics's qos
## module.subscription.1.topic = $client/%c
## module.subscription.1.qos = 0
IIUIC that is a way of creating a unique topic which clients are automatically subscribed to - you still need to publish a message to that particular topic using an MQTT client.
Yes, this is the tricky part,it gives a temp solution for our needs.But with direct delivery it is excellent. It was even much better if there was also a database counterpart that could store dynamic subscriptions.
What is your use-case? It's much better to discuss solutions if we understand the problem you're trying to solve.
it is push notifications like what you see in Google's Firebase
ok - I can't rule out if we might implement something like this at some point - but at the moment it is not a priority, as something like this can easily be modeled by each client subscribing to a simple topic like direct/<client-id>
or similar.
Environment
I want to know if there is any api to send message directly to a device with its clientid without publishing a message to any topic?