IClientConfig and IClientConfigKey of Ribbon
Reference address: http://cloud.spring.io/spring-cloud-netflix/single/spring-cloud-netflix.html#spring-cloud-ribbon
IClientConfig
Its main function is to load configuration information, which is used to initialize clients and load balancers. The default implementation is DefaultClientConfigImpl.
Public IClientConfig set (IClientConfigKey key, T value); public T get (IClientConfigKey key, T defaultValue)
DefaultClientConfigImpl
It loads ClientConfig through Archaius. Configuration parameters can be done through the configuration file or system properties. You can also load IClientConfig programmatically.
Configuration parameter format of the configuration file:
... =
ClientName is matching the service name of a service, such as user.
NameSpace is the namespace, and the default is ribbon.
If there is no clientName, it is valid for all client. Such as:
Ribbon.ReadTimeout=1000 default clientConfig, parameters:
Load the corresponding parameter types through CommonClientConfigKey:
CommonClientConfigKey
Its function is to define various parameters and corresponding types. Implementation features: self-contained definition of constant classes.