The Multicast registration center does not need to start any central nodes, as long as the broadcast address is 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" />
In order to reduce the amount of broadcasting, Dubbo uses unicast to send provider address information to consumers by default.
If multiple consumer processes are started on a machine at the same time, the consumer must declare unicast=false
, otherwise only one consumer can receive the message; when the server and the consumer run on the same machine, the consumer It is also necessary to declare unicast=false
, otherwise the consumer cannot receive the message, resulting in 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 will broadcast to the subscribersMulticast is limited by the network structure and is only suitable for small-scale applications or development stages. Multicast address segment: 224.0.0.0 - 239.255.255.255