Skip to main content

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


Hi there,

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

$share/G/test/#

All three clients are part of group G and get 1/3  messages for topic: test/# 
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?)




Back to the top