feat(registry): add service discovery and health check capabilities
- Integrate tonic-health for gRPC service health monitoring - Add etcd-based service registration with automatic keep-alive - Implement dynamic configuration loading from etcd with fallback - Remove external dependencies from docker-compose for simplified deployment - Refactor service registration logic with improved lease management - Add health service to gRPC server with serving status reporting
This commit is contained in:
@@ -39,11 +39,9 @@ async fn main() -> AppResult<()> {
|
||||
|
||||
let registry = Arc::new(EtcdRegistry::connect(&config).await?);
|
||||
registry.start_discovery().await?;
|
||||
if config.get_env_or("APP_ETCD_REGISTER_SELF", false)? {
|
||||
registry
|
||||
.register_self(&config.rpc_self_service_name()?)
|
||||
.await?;
|
||||
}
|
||||
registry
|
||||
.register_self(&config.rpc_self_service_name()?)
|
||||
.await?;
|
||||
|
||||
let nats = Arc::new(NatsQueue::connect(&config).await?);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user