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.
- Service provider broadcasts its address when it boots up.
- Service consumer broadcasts its subscription request when it boots up.
- Once service provider receives subscription request, it unicasts its own address to the corresponding consumer, if
unicast=falseis set, then broadcast will be used instead.
- When service consumer receives provider's address, it can start RPC invocation on the received address.
Multicast is limited to network topology, and is only suitable for development purpose or small deployment. The valid multcast addresses scope is: 188.8.131.52 - 184.108.40.206.
<dubbo:registry address="multicast://220.127.116.11:1234" />
<dubbo:registry protocol="multicast" address="18.104.22.168: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:registry address="multicast://22.214.171.124:1234?unicast=false" />
<dubbo:registry protocol="multicast" address="126.96.36.199:1234"> <dubbo:parameter key="unicast" value="false" /> </dubbo:registry>