userver: components::DynamicConfigClient Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts

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"
 The default name of components::DynamicConfigClient.
 

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 -
append-path-to-url add default path '/configs/values' to 'config-url' true

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:

    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
Examples
postgresql/functional_tests/basic_chaos/postgres_service.cpp.

Definition at line 42 of file component.hpp.


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