Skip to content

Commit 988c170

Browse files
feat(external_services): Fixed Url for Unified Connector Service gRPC Client (#8587)
1 parent c573f61 commit 988c170

File tree

4 files changed

+11
-19
lines changed

4 files changed

+11
-19
lines changed

config/config.example.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,8 +1145,7 @@ static_routing_enabled = true # Enable or disable Open Router for stat
11451145
url = "http://localhost:8080" # Open Router URL
11461146

11471147
[grpc_client.unified_connector_service]
1148-
host = "localhost" # Unified Connector Service Client Host
1149-
port = 8000 # Unified Connector Service Client Port
1148+
base_url = "http://localhost:8000" # Unified Connector Service Base URL
11501149
connection_timeout = 10 # Connection Timeout Duration in Seconds
11511150

11521151
[billing_connectors_invoice_sync]

config/deployments/env_specific.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,7 @@ merchant_ids = "merchant_ids" # Comma-separated list of allowed mercha
379379
connector_names = "connector_names" # Comma-separated list of allowed connector names
380380

381381
[grpc_client.unified_connector_service]
382-
host = "localhost" # Unified Connector Service Client Host
383-
port = 8000 # Unified Connector Service Client Port
382+
base_url = "http://localhost:8000" # Unified Connector Service Base URL
384383
connection_timeout = 10 # Connection Timeout Duration in Seconds
385384

386385
[chat]

config/development.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,7 @@ static_routing_enabled = false
12451245
url = "http://localhost:8080"
12461246

12471247
[grpc_client.unified_connector_service]
1248-
host = "localhost"
1249-
port = 8000
1248+
base_url = "http://localhost:8000"
12501249
connection_timeout = 10
12511250
ucs_only_connectors = [
12521251
"razorpay",

crates/external_services/src/grpc_client/unified_connector_service.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use common_utils::{consts as common_utils_consts, errors::CustomResult};
1+
use common_utils::{consts as common_utils_consts, errors::CustomResult, types::Url};
22
use error_stack::ResultExt;
33
use masking::{PeekInterface, Secret};
44
use router_env::logger;
@@ -110,11 +110,8 @@ pub struct UnifiedConnectorServiceClient {
110110
/// Contains the Unified Connector Service Client config
111111
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
112112
pub struct UnifiedConnectorServiceClientConfig {
113-
/// Host for the gRPC Client
114-
pub host: String,
115-
116-
/// Port of the gRPC Client
117-
pub port: u16,
113+
/// Base URL of the gRPC Server
114+
pub base_url: Url,
118115

119116
/// Contains the connection timeout duration in seconds
120117
pub connection_timeout: u64,
@@ -151,13 +148,11 @@ impl UnifiedConnectorServiceClient {
151148
pub async fn build_connections(config: &GrpcClientSettings) -> Option<Self> {
152149
match &config.unified_connector_service {
153150
Some(unified_connector_service_client_config) => {
154-
let uri_str = format!(
155-
"https://{}:{}",
156-
unified_connector_service_client_config.host,
157-
unified_connector_service_client_config.port
158-
);
159-
160-
let uri: Uri = match uri_str.parse() {
151+
let uri: Uri = match unified_connector_service_client_config
152+
.base_url
153+
.get_string_repr()
154+
.parse()
155+
{
161156
Ok(parsed_uri) => parsed_uri,
162157
Err(err) => {
163158
logger::error!(error = ?err, "Failed to parse URI for Unified Connector Service");

0 commit comments

Comments
 (0)