Multicast Registry

Multicast registry for dubbo

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.

/user-guide/images/multicast.jpg

  1. Service provider broadcasts its address when it boots up.
  2. Service consumer broadcasts its subscription request when it boots up.
  3. Once service provider receives subscription request, it unicasts its own address to the corresponding consumer, if unicast=false is set, then broadcast will be used instead.
  4. 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: 224.0.0.0 - 239.255.255.255.

Configuration

<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>

Last modified December 22, 2020: clean up website (6e41905afab)