userver: ugrpc::client::ClientFactoryComponent Class Reference
Loading...
Searching...
No Matches
ugrpc::client::ClientFactoryComponent Class Referencefinal

#include <userver/ugrpc/client/client_factory_component.hpp>

Detailed Description

Provides a ClientFactory in the component system.

Multiple ClientFactoryComponent instances may be created if different parameters are required for different clients.

Authentication

Authentication is controlled by auth-type static config field. Possible values:

  • insecure (InsecureChannelCredentials - default)
  • ssl (SslCredentials)

Default (system) authentication keys are used regardless of the chosen auth-type.

Service config

As per https://github.com/grpc/grpc/blob/master/doc/service_config.md service config should be distributed via the name resolution process. We allow setting default service_config: pass desired JSON literal to default-service-config parameter

Static options:

The default component name for static config is "grpc-client-factory".

Name Description Default value
task-processor the task processor for blocking channel creation -
channel-args a map of channel arguments, see gRPC Core docs {}
native-log-level min log level for the native gRPC library 'error'
auth-type authentication method, see above -
default-service-config default service config, see above -
channel-count Number of underlying grpc::Channel objects 1
middlewares middlewares names to use []
See also
https://grpc.github.io/grpc/core/group__grpc__arg__keys.html
Examples
samples/grpc_service/grpc_service.cpp.

Definition at line 57 of file client_factory_component.hpp.

+ Inheritance diagram for ugrpc::client::ClientFactoryComponent:
+ Collaboration diagram for ugrpc::client::ClientFactoryComponent:

Public Member Functions

 ClientFactoryComponent (const components::ComponentConfig &config, const components::ComponentContext &context)
 
ClientFactoryGetFactory ()
 
- 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 = "grpc-client-factory"
 The default name of ugrpc::client::middlewares::log::Component.
 

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