moquette-io / moquette

Java MQTT lightweight broker
http://moquette-io.github.io/moquette/
Apache License 2.0
2.3k stars 818 forks source link

Allow for multiple server side clients to share a topic with queue behavior... #158

Open redboy1972 opened 8 years ago

redboy1972 commented 8 years ago

What I would like to have is load balancing of a topic on the server side. This is because multiple clients can publish significantly faster than a server can consume them.

Possible implementation: A moniker is defined that distinguishes a MQTT topic to be shared in a single consumption round robin fashion by server consumers. A queue hold the consumers and upon message delivery the next in like is dequeued and send the message. It is then appended to the end of list (or array with incrementing index). Not sure but it seems like the fanout within ProtocolProcessor.route2Subscribers could detect the moniker and get the targetSession from the queue.

See this link for better explanation of shared subscriptions: http://www.hivemq.com/docs/hivemq/latest/#hivemqdocs_shared_subscriptions_explained

alamby commented 8 years ago

hi, in my opinion,you're thinking about server cluster?but your exmaple's hivemq is conception of client side share comsupting?both are important,which is my finding

andsel commented 8 years ago

Sorry @redboy1972 but I can't understand you suggestion. You are speaking about a possible implementation, but probably the intention should be described.

Andrea

On Sat, Jun 4, 2016 at 2:47 PM, Amazing-L notifications@github.com wrote:

hi, in my opinion,you're thinking about server cluster?but your exmaple's hivemq is conception of client side share comsupting?both are important,which is my finding

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/andsel/moquette/issues/158#issuecomment-223753826, or mute the thread https://github.com/notifications/unsubscribe/AA_Y0VQtM7hxa02avSE7Hh4sicefNWtbks5qIXPKgaJpZM4Ho-t3 .

alamby commented 8 years ago

hi andsel, cause i'm using java for our simple iot parsing things,i'm very interested in your work,i have't review your codes. 1,i want to know your work about cluster,cause if this stuff is not supported,which we're thinking about using haproxy to achive fake ha,:)
2,like activemq or hivemq's design,cause mqtt hasn't idea about queue,but as to share consumption or LoadBalancing subscription,we also want to know how you're thinking,thx~

andsel commented 8 years ago

Hi @Amazing-L I'm thinking on clustering with Hazelcast, but at the moment Moquette hasn't any scalability or HA facilities.

On Sat, Jun 4, 2016 at 3:28 PM, Amazing-L notifications@github.com wrote:

hi andsel, cause i'm using java for our simple iot parsing things,i'm very interested in your work,i have't review your codes. 1,i want to know your work about cluster,cause if this stuff is not supported,which we're thinking about using haproxy to achive fake ha,:)

2,like activemq or hivemq's design,cause mqtt hasn't idea about queue,but as to share consumption or LoadBalancing subscription,we also want to know how you're thinking,thx~

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/andsel/moquette/issues/158#issuecomment-223755697, or mute the thread https://github.com/notifications/unsubscribe/AA_Y0TihjYX_S0XZBZPbagRWdwMK72E9ks5qIX2UgaJpZM4Ho-t3 .