The Apache ActiveMQ broker supports discovery with IP multicast. This feature is activated in the default 'demo' configuration (see below). I would like to implement the discovery feature in other languages (Delphi / Free Pascal). Is there some minimal code example or introduction page on the web which shows how this would be implemented in Java?
If I understand correctly, the multicast would trigger an answer of the message broker, which contains information about IP and port of the message broker. But I can not figure out which port the client needs to specify (ActiveMQ documentation).
However I can not see which port the multicast client should use.
<!-- Create a TCP transport that is advertised on via an IP multicast
group named default. -->
<transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
...
Update: I found http://docs.oracle.com/javase/tutorial/networking/datagrams/broadcasting.html and try to use this example code.