For old Dubbo 2 users, there are two choices when upgrading to Dubbo 3, and the only consideration for the decision is performance.
Based on the above decision-making conclusions, please adjust the following configuration when upgrading the Dubbo 3 framework.
When upgrading to the Dubbo 3 framework, you need to adjust the application configuration as follows (this is just a configuration adjustment, provider applications must be configured, consumer applications are optional):
<dubbo:application name="xxx" register-mode="interface">
or
dubbo:
application:
name: xxx
register-mode: interface #indicates continuing to use the old version service discovery model, optional values are interface, instance, all
Alternatively, the above is a global default configuration, and can be configured separately for each registration center.
<dubbo:registry address="nacos://localhost:8848" register-mode="interface">
or
dubbo:
registry:
address: nacos://localhost:8848
register-mode: interface #indicates continuing to use the old version service discovery model, optional values are interface, instance, all
For old users, if you want to enable application-level service discovery, a smooth migration process is required. At this point, the newly upgraded Dubbo 3 application needs to perform dual registration and dual subscription (this is the default behavior of the current framework, so users do not need to modify any configuration; the following content will happen automatically. Note: Future versions may switch to single registration and single subscription at the application level) to ensure that both old and new service discovery models can be accommodated.
dubbo.application.register-mode=instance
, which means configuring to use only application-level service discovery from the beginning.By default, the Dubbo 3 framework will register both interface-level and application-level service discovery addresses simultaneously, allowing both new and old applications in the cluster to discover this application address and initiate calls properly. As shown in the figure below:
By default, the Dubbo 3 framework has the capability to discover both Dubbo 2 and Dubbo 3 address lists simultaneously. By default, if there are Dubbo 3 addresses available for consumption in the cluster, it will automatically consume Dubbo 3 addresses; if there are no new addresses, it will automatically consume Dubbo 2 addresses (Dubbo 3 provides a switch to control this behavior), as illustrated in the figure below: