Skip to content

Commit 8ec1593

Browse files
author
frudisch
committed
Use url and port injection to create client to query customer master data
1 parent b0726ca commit 8ec1593

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/k8s/application.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
client.customer-master-data.url: 'customer-master-data-management-service.customer-master-data.svc.cluster.local:9021'
1+
client.customer-master-data:
2+
url: "customer-master-data-management-service.customer-master-data.svc.cluster.local"
3+
port: 9021

src/k8s/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ spec:
2323
resources:
2424
requests:
2525
cpu: "1000m"
26+
memory: "1024Mi"
2627
limits:
2728
cpu: "1000m"
29+
memory: "1024Mi"
2830
readinessProbe:
2931
httpGet:
3032
path: /actuator/health

src/main/kotlin/com/senacor/lpt/service/creditapplication/customer/master/data/adapter/CustomerMasterDataClientConfig.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory
1111
class CustomerMasterDataClientConfig {
1212
@Bean
1313
fun customerMasterDataClient(builder: WebClient.Builder,
14-
@Value("\${client.customer-master-data.url}") baseUrl: String): CustomerMasterDataClient {
15-
val webClient = builder.baseUrl(baseUrl).build()
14+
@Value("\${client.customer-master-data.url}") baseUrl: String,
15+
@Value("\${client.customer-master-data.port}") port: Long): CustomerMasterDataClient {
16+
val webClient = builder.baseUrl(String.format("%s:%d", baseUrl, port)).build()
1617
return HttpServiceProxyFactory.builderFor(WebClientAdapter.create(webClient)).build()
1718
.createClient(CustomerMasterDataClient::class.java)
1819
}

src/test/resources/application-test.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ firestore.database-id=testdb
99
#spring.cloud.gcp.security.firebase.enabled=false
1010

1111
# TODO: replace once needed for tests
12-
client.customer-master-data.url=localhost
12+
client.customer-master-data.url=localhost
13+
client.customer-master-data.port=9021

0 commit comments

Comments
 (0)