0

I have cluster application which listen messages from tge subscription

So I have 1 topic and 1 subsctiption. Following schema works as load balancer so each node in the cluster accepts unique messages. like this

producer produces A, B, C, D, E

Lets say cluster contains 2 nodes. The possible situatiobs is node_1 accepts A and D but node_2 accepts B, C abd E

If I know how many nodes in the cluster I can create subscription for each node. It will allow to listen each message on the each cluster's node. But what if I node count is differs from time to time?(it might increase or decrease). How could I achieve accepting each message from the publisher on each node from the cluster?

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710

1 Answers1

0

As already mentioned in the comments, you would need to use SDK to create subscription from the client on the fly and remove the subscription once the client goes offline.

Don't think there is any other better way than this as the number of clients could go up or down.

skjagini
  • 3,142
  • 5
  • 34
  • 63