Discover a running ActiveMQ message broker using IP multicast

╄→尐↘猪︶ㄣ 提交于 2019-12-12 00:29:05

问题


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.


回答1:


The best source of documentation is always the code itself. If you take a look at the source in SVN for ActiveMQ and browse the org.apache.activemq.transports.discovery package you should have a really good understanding of how the discovery bits works, also the default ports are all in the code.

svn co https://svn.apache.org/repos/asf/activemq/trunk activemq



来源:https://stackoverflow.com/questions/12285666/discover-a-running-activemq-message-broker-using-ip-multicast

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!