B4J Question MQTT Read Only

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

As I am learning MQTT, I have a few questions in regards to how it fully works.

Is there a way to make a topic read only.

What I mean by read only, I mean you can subscribe to the topic but if someone tried to send a message (publish) to this topic to then make it fail to send ?

My aim was to make a announcements topic, where all users subscribe to this topic but only the admin could send messages to this topic. I understand I could limit users by setting code in the app to stop the message from being sent to this topic but I was hopping to stop it at the server side from being sent to everyone.

The aim for this announcements topic was to send messages like reboot300 which would mean the server is going to get rebooted in 300 seconds time (5mins), and then I can make it do something in the app when this message is received.

I don't then want users to then be able to send a message back to this announcement otherwise all users would get this message, and I don't want that to happen.

The only way I can think of is make a private topic for each user and then have to send the message multiple times to each of the private topics.
 
Top