Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] sharing subscriptions among connected group members

Hi Peter,

the behavior you described that you want only online clients to receive messages is the behavior that should be expected with Shared Subscriptions. Also that unacked messages are redistributed among subscribers that are online is something that some brokers implement. The MQTT 5 spec has some room for implementation-specific behavior.

If you want to verify that what you are seeing is not an application bug but the behavior you see is a mosquitto implementation detail, you could also test against other (open source) MQTT brokers like HiveMQ Community Edition or you could quickly test against a free online MQTT broker like HiveMQ Cloud.


On 8 Apr 2021, at 2:52, Peter Silva wrote:

Hi there,

Example: client A, B, and C establish sessions subscribed to:


All three clients are part of group G and get 1/3 messages for topic:
So far, so good.. but let's say B dies... ... so sad... Once we have
determined that B is dead, I would want the broker to send half the
messages to A and the other half to C.

My tests are really short (a few minutes) so perhaps I didn't give it
enough of a chance, but as far as I can tell, it continues to split 1/3,
1/3, 1/3 forever queueing up for the B that is gone. If D comes in... then
it gets 1/4, as do A and C, and 1/4 piles up with B. I imagine I could
connect with B again, and do an unsubscribe, to tell the broker that B has
left the group... but that relies on b being healthy enough to do so.

It would be nice if there were a way to tell the broker to round-robin
among the clients that are currently connected? so the collective work
continues at 1/3 slower aggregate rate, but without queueing 1/3 of the
work forlornly for B to return. When you decide B is dead, it should also
re-distribute the queue of unacknowledged messages in it's queue to the
remaining group members.

Leaving a queue for B will mean the load will be asymmetrical for some time
after it returns, as it will be processing its backlog.

Does this seem reasonable, and is there a way to convince a broker to
behave this way (e.g. mosquitto?)
paho-dev mailing list
To unsubscribe from this list, visit

Back to the top