Github   Telegram
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
components::DynamicConfigClient Class Reference

Component that starts a clients::dynamic_config::Client client. More...

#include <userver/dynamic_config/client/component.hpp>

+ Inheritance diagram for components::DynamicConfigClient:
+ Collaboration diagram for components::DynamicConfigClient:

Public Member Functions

 DynamicConfigClient (const ComponentConfig &, const ComponentContext &)
 
dynamic_config::ClientGetClient () const
 
- Public Member Functions inherited from components::LoggableComponentBase
 LoggableComponentBase (const ComponentConfig &, const ComponentContext &)
 
 LoggableComponentBase (LoggableComponentBase &&)=delete
 
 LoggableComponentBase (const LoggableComponentBase &)=delete
 
 ~LoggableComponentBase () override=default
 
ComponentHealth GetComponentHealth () const override
 
void OnLoadingCancelled () override
 
void OnAllComponentsLoaded () override
 
void OnAllComponentsAreStopping () override
 

Static Public Member Functions

static yaml_config::Schema GetStaticConfigSchema ()
 
- Static Public Member Functions inherited from components::LoggableComponentBase
static yaml_config::Schema GetStaticConfigSchema ()
 

Static Public Attributes

static constexpr std::string_view kName = "dynamic-config-client"
 

Detailed Description

Component that starts a clients::dynamic_config::Client client.

Returned references to clients::dynamic_config::Client live for a lifetime of the component and are safe for concurrent use.

The component must be configured in service config.

Static options:

Name Description Default value
get-configs-overrides-for-service send service-name field true
service-name name of the service to send if the get-configs-overrides-for-service is true -
http-timeout HTTP request timeout to the remote in utils::StringToDuration() suitable format -
http-retries HTTP retries before reporting the request failure -
config-url HTTP URL to request configs via POST request -

configs-stage: stage name provided statically, can be overridden from file | - configs-stage-filepath: file to read stage name from, overrides static "configs-stage" if both are provided, expected format: json file with "env_name" property | - fallback-to-no-proxy | make additional attempts to retrieve configs by bypassing proxy that is set in USERVER_HTTP_PROXY runtime variable | true

Static configuration example:

# yaml
dynamic-config-client:
get-configs-overrides-for-service: true
service-name: common_component_list-service
http-timeout: 20s
http-retries: 5
config-url: http://localhost:8083/
configs-stage: $configs_stage
fallback-to-no-proxy: false

Definition at line 41 of file component.hpp.

Member Data Documentation

◆ kName

constexpr std::string_view components::DynamicConfigClient::kName = "dynamic-config-client"
staticconstexpr

Definition at line 43 of file component.hpp.


The documentation for this class was generated from the following file: