hermes-server
gRPC server crate for the Hermes broker.
This crate provides the server runtime: publishing, fanout / queue-group subscriptions, and durable mode (with storage) when enabled.
Installation
Add the dependency:
[]
= "0.3"
= { = "1", = ["full"] }
Quick start
1) Start with default config
use TcpListener;
async
2) Start with custom config
use TcpListener;
use ServerConfig;
async
Configuration via environment variables
You can build config from the environment with ServerConfig::from_env().
Supported variables:
HERMES_LISTEN_ADDR(e.g.0.0.0.0:4222)HERMES_CHANNEL_CAPACITYHERMES_GRPC_OUTPUT_BUFFERHERMES_STORE_PATH(enables durable mode)HERMES_REDELIVERY_INTERVALHERMES_MAX_DELIVERY_ATTEMPTSHERMES_RETENTION_SECSHERMES_ACK_TIMEOUTHERMES_MAX_IN_FLIGHTHERMES_GC_INTERVALHERMES_REDELIVERY_BATCH_SIZE
Example:
HERMES_LISTEN_ADDR=0.0.0.0:4222 \
HERMES_STORE_PATH=./hermes.redb \
HERMES_RETENTION_SECS=86400 \
Notes
- Without
HERMES_STORE_PATH(orstore_path = None), the server runs in fire-and-forget mode. - With a configured store, redelivery and GC loops are automatically enabled.
- The service also exposes gRPC reflection for API inspection.