Service Downgrade

Downgrade service in dubbo

You can temporarily shield a non-critical service through the service downgrade and define the return policy for it.

Publish dynamic configuration rule to the registry:

RegistryFactory registryFactory = ExtensionLoader.getExtensionLoader(RegistryFactory.class).getAdaptiveExtension();
Registry registry = registryFactory.getRegistry(URL.valueOf("zookeeper://"));
  • The configuration mock=force:return+null means that all calls of this service will return null value directly,without making remote calls.Usually used to reduce the effect of some slow non-critical services.

  • Also you can change that configuration to mock=fail:return+null.Then you will get null value after a failed call.Consumer will try to make a remote call to get the truely result if succeed,and if the call failed you will get null value.Usually used to tolerate some non-critical services.

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