

Use the DNS to Announce Your ZeroMQ Services - Loic
http://www.ceondo.com/ecte/2011/12/dns-zeromq-services

======
darklajid
So.. What exactly is wrong with using SRV records [1] in this case?

1: <https://en.wikipedia.org/wiki/SRV_record>

~~~
Loic
In this particular case it is that I want to provide more than just a end
point and a port. A JSON string is put in the TXT record to store associated
meta data. If you do not need these metadata, SRV record is perfect.

------
sqrt17
What's wrong with using something like ZooKeeper? In my understanding, master
election, storage of configuration data and the likes are what it's made for;
and you can have multiple ZK servers that still contain one single
configuration database.

~~~
Loic
It is extremely heavy to setup for just 50 JSON strings to share with 50 to
150 VMs.

~~~
AdamGibbins
<https://github.com/lusis/Noah> is a much lighter alternative.

~~~
Loic
Interesting, a service registry in Ruby. If you already have redis etc.
running on your system, why not. But as I already have the dns servers running
— for my specific use case — you cannot beat it, because it means just one
line per service in my DNS server configuration to have it available.

------
rumcajz
We've actually implemented automatic DNS search withing 0MQ itself. You can
then use it like this:

zmq_connect (s, "dns://myservice.example.org");

If people are interested in that, we can upload it to github.

~~~
rumcajz
It seems to be available already. Check it out here:

<https://github.com/mato/libzmq/tree/dns>

Thanks to VMware for sponsoring the feature!

~~~
Loic
Very nice, it is by the way using a TXT record to store the information. As
pointed out before, an SRV record could be better (but only for udp/tcp for
the transport mechanism).

[https://github.com/mato/libzmq/commit/d2782c7b1c401037718eaf...](https://github.com/mato/libzmq/commit/d2782c7b1c401037718eaf5589ceb9548a82a2bc#L7R315)

~~~
mato
Yes, it's using a TXT record precisely so that we can store any endpoint URL.
An alternative using SRV records could of course be easily implemented.

The implementation is very much a 1st cut at the moment (no real error
handling, no load balancing of multiple records, and the integration of dns.c
needs work) and has not been officially announced, will do so on the zeromq-
dev list shortly.

