Evilolipop
Evilolipop

Reputation: 117

Distributed MQTT subscriber

Here is my application:

  1. The user can enter the broker's IP, username, pwd, topics and press create on the web.
  2. The server will create a mqtt client, connect it to the broker and subscribe the topics.
  3. When some messages are received, some tasks are performed.
  4. The user do not need to reconnect and resubscribe by hand.

It is quite simple when there is a single server node but I want to make it high available. For example, if 100 clients have created on one node, when I start a second node, 50 clients should be deleted on the first node and started on the second. If some nodes are down, the clients should be started on others.

To be clear, I do not known in advance brokers' infomation and how many clients users want to create.

I have been checking many virtual actor frameworks like dapr, Orleans but they all need actors to be called to activate it which in my case, after the creation, no one is actually calling anything except callbacks called by subscriptions.

My current solution is to use etcd's watching feature.

My question is

  1. if one node is partitioned from etcd and still running, the lock will be released and there will be two clients started which will cause the broker constantly kicking them.

  2. Any other solutions?

Upvotes: 0

Views: 45

Answers (0)

Related Questions