Multicast registry doesn’t require to setup any central node. Just like IP address broadcast, dubbo service providers and consumers can discover each other through this mechanism.
unicast=false
is set, then broadcast will be used instead.Multicast is limited to network topology, and is only suitable for development purpose or small deployment. The valid multcast addresses scope is: 224.0.0.0 - 239.255.255.255.
<dubbo:registry address="multicast://224.5.6.7:1234" />
Or
<dubbo:registry protocol="multicast" address="224.5.6.7:1234" />
In order to avoid multicast as much as possible, dubbo uses unicast for address information from service provider to service consumer, if there are multiple consumer processes on one single machine, consumers need to set unicast=false
, otherwise only one consumer can be able to receive the address info:
<dubbo:application name="demo-consumer">
<dubbo:parameter key="unicast" value="false" />
</dubbo:application>
Or
<dubbo:consumer>
<dubbo:parameter key="unicast" value="false" />
</dubbo:consumer>