I have the following problem:
There is a group of ZMQ-based brokers in the cloud. These would be operated in a Amazon VPC, using a certain IP range.
There are also client apps, these are running on all kinda hosts, and can be located anywhere in the world.
I want these clients to auto discover the available brokers.:
Broker1: 172.44.22.33
Broker2: 172.44.22.34
Broker3: 172.44.22.35
Broker4: 172.44.22.36
....
Client: 82.34.55.12
...when this client starts up, it should fetch the above list of broker IPs.
My question is what's the best way to do this?
Of course the client could use brute force method, trying to connect to all IPs in the range, but this not a nice or efficient solution.
I guess, the VPC could support multicast (via n2n), in which case the client would send a multicast message and the available brokers would "reply" to that using the sender IP, which is always part of the multicast data (as far as I know).
But isn't there a better way to do this? I need the clients to auto discover, because this has to be a zero configuration system.
I know discovery can be done easily on a LAN, either using multicast / broadcast or stuff like bonjure / zeroconf. But the clients are not part of my network, they can be located anywhere.
Thanks in advance!
EDIT:
I know this could be solved in other ways too, like adding "config servers" which would store info about the available brokers, but I would prefer a decentralized solution.
EDIT2:
It seems DNS-SD could be used for this purpose, since wide area discovery is supported. As I can see, I can add some special DNS entries to my DNS server even manually.
The clients only have to know about a domain name whose DNS records stores the data of advertised services.
I guess, the clients need to integrate bonjur / avahi libs or some other DNS-SD implementation to do these queries, right? What's the best free library for this, avahi?