The global configuration defines the globally shared configurations, mainly including container and environment-related configurations.
Configuration Domain | Configuration Name | Configuration Type | Default Value | Deprecated | Configuration Explanation |
---|---|---|---|---|---|
global | namespace | string | None | No | Environment type, divided into formal (Production) and informal (Development) types, supporting customizations |
global | env_name | string | None | No | Environment name, the name of multiple environments in an informal environment |
global | container_name | string | None | No | Container name |
global | enable_set | string | None | No | Whether to enable set-based routing, not enabled by default, Y to enable |
global | full_set_name | string | None | No | Set name |
global | ext | map | None | No | Global extended parameters |
The server configuration defines the server-related configurations, management configurations ( AdminConfig), and service mapping list configurations (ServiceConfig). The service mapping configuration (ServiceConfig) also includes service exposure list configurations (ProviderConfig).
The server configuration defines server-related configurations, management configurations ( AdminConfig), and service mapping list configurations (ServiceConfig). Service mapping configuration (ServiceConfig) also includes service exposure list configurations (ProviderConfig).
Configuration Domain | Configuration Name | Configuration Type | Default Value | Deprecated | Configuration Explanation |
---|---|---|---|---|---|
server | app | string | None | No | Application name of the business |
server | server | string | None | No | Service name of the business |
server | local_ip | string | 127.0.0.1 | No | Local IP address |
server | nic | string | None | No | Local network card (e.g., eth1), used to obtain local IP, generally configured with IP |
server | server_listener | string list | None | No | Register server-side general Listener, class implementing the ServerListener interface, configure the full path of the implementation class |
server | close_timeout | int | 30000ms | No | Shutdown timeout for server thread pool |
server | wait_timeout | int | 5000ms | No | After unregistering the service, wait time |
server | request_timeout | int | 2147483647 ms | No | Request timeout (server-side global) |
server | worker_pool | string | trpc_provider_biz_def | No | Name of the worker thread pool, default value |
server | filters | string list | None | No | Filter list configuration |
server | enable_link_timeout | boolean | false | No | Whether to enable full link timeout, not enabled by default |
server | config_center | string | None | No | Configuration center used [nacos] |
server | admin | map | None | No | Admin management background configuration |
server | service | map | None | No | Exposed service configuration |
server.admin | admin_ip | string | None | No | Management background IP |
server.admin | admin_port | int | None | No | Management background port |
server.service | name | string | None | No | Used for name service addressing |
server.service | version | string | v1.0.0 | No | Service version number |
server.service | group | string | normal | No | Service group |
server.service | impls | list | None | No | List of exposed service implementations, find the interface according to the implementation |
server.service.impls | impl | string | None | No | Service implementation |
server.service.impls | worker_pool | string | None | No | Thread pool name |
server.service.impls | request_timeout | string | None | No | Timeout |
server.service.impls | filters | string | None | No | Filter list |
server.service.impls | enable_link_timeout | string | None | No | Full link timeout |
server.service | ip | string | None | No | Local IP |
server.service | nic | string | None | No | Used to obtain local IP, generally configured with IP |
server.service | port | int | None | No | Port |
server.service | network | string | tcp | No | Network connection protocol, [tcp, udp] |
server.service | protocol | string | trpc | No | Communication protocol, [trpc, http, rest] |
server.service | base_path | string | trpc | No | Base path, prefix path |
server.service | serialization | string | pb | No | Serialization protocol, [pb, json, jpb (Java pb)] |
server.service | compressor | string | none | No | Compression method, [none, gzip, snappy] |
server.service | compress_min_bytes | int | 65535 | No | Minimum number of bytes for compression, default 64KB, even if compression is enabled, if the body is smaller than this byte, it will not be compressed |
server.service | transporter | string | netty | No | Transporter server side, [netty, jetty], jetty needs to be used with protocol=http |
server.service | charset | string | utf8 | No | Character set |
server.service | keep_alive | boolean | true | No | Whether to keep the connection alive |
server.service | max_conns | int | 1024 * 20 | No | Maximum number of connections |
server.service | backlog | int | 1024 | No | Backlog size, corresponding to Netty's so_backlog |
server.service | send_buffer | int | 16384 | No | Send buffer |
server.service | receive_buffer | int | 16384 | No | Receive buffer |
server.service | payload | int | 10485760(10M) | No | Package size limit |
server.service | idle_timeout | int | 180000ms | No | Idle time |
server.service | request_timeout | int | 2147483647 ms | No | Request timeout |
server.service | lazyinit | boolean | false | No | Whether to delay initialization |
server.service | io_mode | string | epoll | No | IO mode [epoll] |
server.service | io_thread_group_share | boolean | true | No | Whether the IO thread is shared |
server.service | io_threads | int | cpus * 2 | No | Number of IO threads |
server.service | boss_threads | int | 1 | No | Number of boss threads, the default number of threads accepting requests is 1, which is the optimal solution, and can also be set according to the actual scenario |
server.service | ext_map | map | None | No | Extended configuration |
server.service | worker_pool | string | trpc_provider_biz_def | No | Thread pool name |
server.service | registrys | map | None | No | Multi-registry configuration |
server.service | filters | string list | None | No | Filter list configuration |
server.service | enable_link_timeout | boolean | false | No | Whether to enable full link timeout, not enabled by default |
server.service | reuse_port | boolean | false | No | Whether to enable the reusePort option |
server.service | is_batch_decoder | boolean | true | No | Whether to enable batch decoding |
server.service | explicit_flush_after_flushes | int | 2048 | No | High throughput flush |
The server configuration defines client-related configurations (such as netty), and client mapping list configurations (BackendConfig).
Configuration Domain | Configuration Name | Configuration Type | Default Value | Deprecated | Configuration Explanation |
---|---|---|---|---|---|
client | namespace | string | None | No | Environment type, divided into formal (Production) and informal (Development) types, not configured when using global configuration |
client | request_timeout | int | 1000ms | No | Client-side global request timeout |
client | protocol | string | trpc | No | (Client-side global) Request communication protocol [trpc, http] |
client | network | string | tcp | No | (Client-side global) Request connection protocol [tcp, udp] |
client | serialization | string | PB | No | (Client-side global) Serialization protocol [pb, json, jpb (Java pb)] |
client | compressor | string | none | No | (Client-side global) Compression method [none, gzip, snappy] |
client | compress_min_bytes | int | 65535 | No | (Client-side global) Minimum number of bytes for compression, default 64KB, even if compression is enabled, if the body is smaller than this byte, it will not be compressed |
client | charset | string | UTF-8 | No | (Client-side global) Character set encoding format |
client | send_buffer | int | 16384 | No | (Client-side global) Send buffer size |
client | receive_buffer | int | 16384 | No | (Client-side global) Receive buffer size |
client | keep_alive | boolean | true | No | (Client-side global) Whether to keep the connection alive |
client | io_thread_group_share | boolean | true | No | (Client-side global) Whether the IO thread is shared |
client | io_threads | int | cpus * 2 | No | (Client-side global) Number of IO threads |
client | transporter | string | netty | No | (Client-side global) transporter |
client | idle_timeout | int | 180000 ms | No | (Client-side global) Idle timeout |
client | lazyinit | boolean | false | No | (Client-side global) Whether to delay initialization |
client | conns_per_addr | int | 2 | No | (Client-side global) Number of connections per addr |
client | conn_timeout | int | 1000ms | No | (Client-side global) Client connection timeout |
client | worker_pool | string | trpc_consumer_biz_def | No | (Client-side global) Thread pool ID |
client | filters | string list | None | No | (Client-side global) Interceptor list |
client | interceptors | string list | None | No | (Client-side global) ClusterInvoker interceptor, intercept before filters |
client | cluster_config_map | map | None | No | TRPC client cluster configuration, implemented in code |
client | caller_service_name | string | None | No | (Client-side global) Main service name for Polaris addressing |
client | service | map | None | No | TRPC client configuration |
client.service | name | string | "@BackendConfig(" + nameGeneratorIndex.getAndAdd(1) + ")" | No | Backend cluster name (used for lookup by TRpcProxy) |
client.service | version | string | v1.0.0 | No | Service version number |
client.service | group | string | normal | No | Service group |
client.service | interface | string | None | No | TRPC client-specific interface |
client.service | naming_url | string | None | No | Route discovery @Alias(target), Java recommends using .naming configuration, direct connection ip://ip:port, name service: polaris://trpc.TestApp.TestServer.Greeter?key=value&key=value l5://mid:cmid cmlb://id |
client.service | naming_map | map | None | No | Extended parameters |
client.service | namespace | string | None | No | Environment type, divided into formal (Production) and informal (Development) types, not configured when using global configuration |
client.service | callee | string | serviceName | No | Main call information |
client.service | network | string | tcp | No | Network connection protocol, [tcp, udp] |
client.service | protocol | string | trpc | No | Communication protocol, [trpc, http] |
client.service | serialization | string | pb | No | Serialization protocol, [pb, json, jpb (Java pb)] |
client.service | compressor | string | no | No | Compression method, [none, gzip, snappy] |
client.service | compress_min_bytes | int | 65535 | No | Minimum number of bytes for compression, default 64KB, even if compression is enabled, if the body is smaller than this byte, it will not be compressed |
client.service | transporter | string | netty | No | Transporter server side, [netty, jetty], jetty needs to be used with protocol=http |
client.service | charset | string | utf8 | No | Character set |
client.service | keep_alive | boolean | true | No | Whether to keep the connection alive |
client.service | max_conns | int | 1024 * 20 | No | Maximum number of client connections |
client.service | send_buffer | int | 16384 | No | Send buffer |
client.service | receive_buffer | int | 16384 | No | Receive buffer |
client.service | payload | int | 10485760(10M) | No | Package size limit |
client.service | idle_timeout | int | 180000ms | No | Idle time |
client.service | request_timeout | int | 10000ms | No | Request timeout |
client.service | conn_timeout | int | 1000ms | No | Client connection timeout |
client.service | conns_per_addr | int | 2 | No | Number of client connections |
client.service | lazyinit | boolean | false | No | Whether to delay initialization |
client.service | io_thread_group_share | boolean | true | No | Whether the IO thread is shared |
client.service | io_threads | int | cpus * 2 | No | Number of IO threads |
client.service | ext_map | map | None | No | Extended configuration |
client.service | naming_map | map | None | No | Polaris extended configuration |
client.service.naming_map | metadata | map | None | No | Polaris metadata configuration |
client.service | mock | boolean | false | No | Whether to mock, default false |
client.service | mock_class | string | None | No | Mock class |
client.service | worker_pool | string | trpc_consumer_biz_def | No | Thread pool name |
client.service | filters | string list | None | No | Filter list configuration |
client.service | is_batch_decoder | boolean | true | No | Whether to enable batch decoding |
client.service | explicit_flush_after_flushes | int | 2048 | No | High throughput flush |
client.service | caller_service_name | string | None | No | Main service name for Polaris addressing |
Plugin configuration is responsible for loading all framework plugin configurations
First, list the supported plugins, followed by the specific configuration parameters for the plugins.
Configuration Domain | Configuration Name | Configuration Type | Default Value | Deprecated | Configuration Explanation | Implemented |
---|---|---|---|---|---|---|
plugins | worker_pool | map | None | No | Thread pool | thread |
plugins | config | string | None | No | Remote configuration | nacos |
plugins | filter | string | None | No | filter | opentelemetry |
plugins | selector | string | None | No | Route selector | polaris, ip, zookeeper |
plugins | registry | string | None | No | Registry | polaris |
plugins | telemetry | string | None | None | Link tracking | opentelemetry |
plugins | limiter | string | None | None | Rate limiting | sentinel |
Configuration Domain | Configuration Name | Configuration Type | Default Value | Deprecated | Configuration Explanation |
---|---|---|---|---|---|
plugins.worker_pool | 'name'-Thread pool name | map | None | No | Thread pool name and specific project configuration |
plugins.worker_pool.name | _type | string | None | No | Fill in the name of the plugin to find the plugin, [default, thread, forkJoinPool], when this item is not configured, the name is used as the plugin name to find the plugin |
plugins.worker_pool.name | core_pool_size | int | 0 | No | Number of core threads |
plugins.worker_pool.name | maximum_pool_size | int | core_pool_size | No | Maximum number of threads |
plugins.worker_pool.name | keep_alive_time_seconds | int | 60s | No | Maximum thread idle time |
plugins.worker_pool.name | queue_size | int | 0 | No | Queue size, 0 means unlimited |
plugins.worker_pool.name | allow_core_thread_timeout | boolean | true | No | Whether to recycle core threads on timeout |
plugins.worker_pool.name | name_prefix | string | None | No | Thread name prefix in thread pool |
plugins.worker_pool.name | deamon | boolean | true | No | Whether it is a daemon thread |
plugins.worker_pool.name | close_timeout | int | 10s | No | Timeout |
plugins.worker_pool.name | use_fiber | boolean | false | 否 | Whether to use coroutines |
plugins.worker_pool.name | fiber_parallel | int | cpus | 否 | The scheduling thread pool parallelism level of the coroutine |
plugins.worker_pool.name | share_schedule | boolean | true | 否 | Whether the coroutine pool shares the scheduler |
plugins.worker_pool.forkJoinPool | parallel | int | 2 | No | Number of parallel threads |
plugins.worker_pool.forkJoinPool | timeoutMs | int | 2000 | No | Thread pool shutdown timeout, in milliseconds |