Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

IClientConfig and IClientConfigKey of Ribbon

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report