Notification whenever a new topic is created on mosquitto

329 views Asked by At

I am trying to implement Push notifications on Android, using Mosquitto broker. So, different android application create topics based on tehir id on which they will receive notifications. To send notifications to those android applications we need the name of the topic. I am wondering if there is a way to notifiy an application whenever a new topic is created (a new android app is registered). This way, we will have a list of all the topics (so all the androi apps) and we can cpntact them by publishing on their topics.

thanks

1

There are 1 answers

1
hardillb On BEST ANSWER

A topics is only "created" when something is published to it the first time.

There is no mechanism to detect this apart from subscribing to a wildcard topic that would match all topics of interest and triggering processing when the first message is received on a given topic.

In the case you mentioned you could use a status topic to show when a device is online (and use the Last Will and Testament feature to set offline status) and a separate (but derived) topic for messaging.