Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Subscriber list

Hello Roger,

This is potentially very useful if you also consider that mosquitto is being deployed into situations that you may not have considered originally. I'm currently testing out its viability in a low-power ARM/Linux board to act as a central, standard, IPC mechanism within the board itself. Several applications are running, each monitoring the data from a smart peripheral on Serial, SPI, or I2C connection, and when data arrives it is simply published to mosquitto. There might only be one or two clients listening on a topic.

Several of the peripherals are power hogs, and need to be kept off when not in use. The GPS is a good example. It consumes as much power as the rest of the system. So it can be powered up when the first client subscribes to the topic "data/gps/location" or "data/gps/time", and then powered down after the last client unsubscribes from those topics.

This could be done by having the clients manually publish control requests ("control/gps [on|off]") but this $SYS/broker/log facility might be a more elegant solution.

What does the broker do if a client disconnects unexpectedly? At the point where a last will message would be sent out? Is this noted in $SYS/broker/log in any way? The last thing we'd want to do is keep the GPS powered up forever if the last client crashed before unsubscribing.

Thanks,
Frank

On 10/10/2014 03:39 AM, Roger Light wrote:
Hi Romu,

You could do this quite easily by configuring the broker to do
subscribe and unsubscribe logging. You could write a client that
listens to $SYS/broker/log/M/subscribe and
$SYS/broker/log/M/unsubscribe and publishes the list to a topic as a
retained message.

In general I'm not sure about how wise this is though. If you've got a
fairly active server with clients connecting and disconnecting, then
the amount of bandwidth you'd be devoting to this task would be
considerable.With a naive implementation, if you had 10,000 clients
connected each with a 36 byte client id (e.g. UUID), then you would be
sending a 360kB message each time a client subscribed/unsubscribed.

Cheers,

Roger

On Fri, Oct 10, 2014 at 4:55 AM, Romu Hu <huruomu@xxxxxxxxx> wrote:
Hi,

Is it possible for mosquitto to provide subscriber list to client? For
example, to get the subscriber list of a topic, the client subscribes to
$SYS/broker/subscribers/[topic], the broker sends the list to the client.

Any hint on how to implement this in mosquitto?


Thanks
Romu
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev




Back to the top