RPC Service Configuration
RPC Service Configuration
Section titled “RPC Service Configuration”All fields for zrpc.RpcServerConf and zrpc.RpcClientConf.
Server Config
Section titled “Server Config”Name: my.rpc # service name (required)ListenOn: 0.0.0.0:8080 # bind address:port (required)
# ── Service Discovery ────────────────────────────────────────────────────────Etcd: Hosts: - 127.0.0.1:2379 Key: my.rpc # discovery key
# ── TLS ─────────────────────────────────────────────────────────────────────# CertFile: /path/to/cert.pem# KeyFile: /path/to/key.pem
# ── Timeouts ─────────────────────────────────────────────────────────────────Timeout: 2000 # server-side deadline ms
# ── CPU-based Load Shedding ──────────────────────────────────────────────────CpuThreshold: 900
# ── Prometheus ───────────────────────────────────────────────────────────────Prometheus: Host: 0.0.0.0 Port: 9102 Path: /metrics
# ── Telemetry ────────────────────────────────────────────────────────────────Telemetry: Name: my.rpc Endpoint: http://jaeger:14268/api/traces Sampler: 1.0 Batcher: jaegerClient Config
Section titled “Client Config”MyRpc: # Option 1: static endpoints Endpoints: - 127.0.0.1:8080
# Option 2: etcd discovery Etcd: Hosts: [127.0.0.1:2379] Key: my.rpc
Timeout: 2000 # client-side deadline ms KeepaliveTime: 20000 # keepalive ping interval ms
# TLS (mutual) # App: # CertFile: client.pem # KeyFile: client.key # CaCert: ca.pem