#include <userver/ugrpc/client/client_factory_component.hpp>
Provides a ClientFactory in the component system.
Multiple ClientFactoryComponent instances may be created if different parameters are required for different clients.
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.
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
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 | [] |
Definition at line 57 of file client_factory_component.hpp.
Public Member Functions | |
ClientFactoryComponent (const components::ComponentConfig &config, const components::ComponentContext &context) | |
ClientFactory & | GetFactory () |
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. | |