The Multicast registry center does not require starting any central node; as long as the broadcast addresses are the same, they can discover each other.
<dubbo:registry address="multicast://224.5.6.7:1234" />
or
<dubbo:registry protocol="multicast" address="224.5.6.7:1234" />
To reduce broadcast volume, Dubbo defaults to sending provider address information to consumers via unicast. If multiple consumer processes are started on one machine, the consumer must declare unicast=false
, otherwise only one consumer will receive the message; when the provider and consumer run on the same machine, the consumer also needs to declare unicast=false
, otherwise the consumer cannot receive messages, leading to the No provider available for the service exception:
<dubbo:application name="demo-consumer">
<dubbo:parameter key="unicast" value="false" />
</dubbo:application>
or
<dubbo:consumer>
<dubbo:parameter key="unicast" value="false" />
</dubbo:consumer>
unicast=false
is set, it broadcasts to the subscriberMulticast is limited by network structure and is only suitable for small-scale applications or use during the development phase. Multicast address range: 224.0.0.0 - 239.255.255.255