← Back to team overview

mosquitto-users team mailing list archive

an user group subscribe the same topic

 

Dear all, 

  "The MQTT protocol is based on the principle of publishing messages
and subscribing to topics. Multiple clients connect to a broker and
subscribe to topics that they are interested in. "
    In actual applications, multiple clients subscrible the same
topics and play by the same ACL rule. Therefore, to make ACL simple,
the most convinient method is to set these multiple clients as an
user group.  For example, we can treat anonymous users as an user
group, then we can set this group privillege with the following
configurations:
    topic [read|write] <topic>



    
     However,  it seems that we don't have other methods to divide
users into groups. So if we want to set the same privillege for
multiple clients, we have to set it one by one.  This work is tedious 
and doesn't meet the third Design Principles and Assumptions:
     "Zero administration (or as close as possible). Behave sensibly
in response to unexpected actions and enable applications to 'just
work'  e.g. dynamically create topics when needed. "

    Users which belong to the same group listen to the same listener
and add per-listener ACL configuration may be one feasible solution.
Whereas some configurations(per-listener ACL configuration) are also
needed.
    
    Another suggest is to simulate phone number design ,we  can add
the same prefix for users which belong to the same group. Thus ,we
can add ACL as follows:

   pattern  sensor/%u(mobile1#)/data
   
   this  means user which name starts with 'mobile1' can read|write
each other.

   
   Is this function  possible with mosquitto? 

   
   Best regards,

HE Guangyu



Follow ups