Redis client component.
More...
#include <userver/storages/redis/component.hpp>
Redis client component.
Provides access to a redis cluster.
Dynamic options:
Static options:
Name | Description | Default value |
thread_pools.redis_thread_pool_size | thread count to serve Redis requests | - |
thread_pools.sentinel_thread_pool_size | thread count to serve sentinel requests. | - |
groups | array of redis clusters to work with excluding subscribers | - |
groups.[].config_name | key name in secdist with options for this cluster | - |
groups.[].db | name to refer to the cluster in components::Redis::GetClient() | - |
groups.[].sharding_strategy | one of RedisCluster, KeyShardCrc32, KeyShardTaximeterCrc32 or KeyShardGpsStorageDriver | "KeyShardTaximeterCrc32" |
groups.[].allow_reads_from_master | allows read requests from master instance | false |
subscribe_groups | array of redis clusters to work with in subscribe mode | - |
subscribe_groups.[].config_name | key name in secdist with options for this cluster | - |
subscribe_groups.[].db | name to refer to the cluster in components::Redis::GetSubscribeClient() | - |
subscribe_groups.[].sharding_strategy | either RedisCluster or KeyShardTaximeterCrc32 | "KeyShardTaximeterCrc32" |
Static configuration example:
redis:
groups:
- config_name: taxi-tmp
db: taxi-tmp
sharding_strategy: "RedisCluster"
- config_name: taxi-tmp-pubsub
db: taxi-tmp-pubsub
subscribe_groups:
- config_name: taxi-tmp-pubsub
db: taxi-tmp-pubsub
thread_pools:
redis_thread_pool_size: 8
sentinel_thread_pool_size: 1
- Examples
- samples/redis_service/redis_service.cpp.
Definition at line 89 of file component.hpp.
The documentation for this class was generated from the following file: