- add: consul tags and metadata
- update: login reply now requests for the character services from consul to build the server list
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use std::collections::HashMap;
|
||||
use database::database_service_server::DatabaseServiceServer;
|
||||
use database_service::database;
|
||||
use database_service::db::Database;
|
||||
@@ -38,12 +39,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
// Register service with Consul
|
||||
let service_id = consul_registration::generate_service_id();
|
||||
let tags = vec!["version-1.0".to_string()];
|
||||
let mut meta = HashMap::new();
|
||||
consul_registration::register_service(
|
||||
&consul_url,
|
||||
service_id.as_str(),
|
||||
service_name.as_str(),
|
||||
service_address,
|
||||
service_port.parse().unwrap_or(50052),
|
||||
tags,
|
||||
meta,
|
||||
&health_check_url,
|
||||
)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user