From 76ea7b062a244119a5f3c5571b7cfcfe9261f060 Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Mon, 14 Oct 2024 22:52:08 +0200 Subject: [PATCH] use of external configuration Signed-off-by: Peter Siegmund --- pom.xml | 4 +++ src/main/resources/application-dev.yaml | 7 +++-- src/main/resources/application.yaml | 35 ++----------------------- 3 files changed, 9 insertions(+), 37 deletions(-) diff --git a/pom.xml b/pom.xml index 0bebda6..b2532ba 100644 --- a/pom.xml +++ b/pom.xml @@ -88,6 +88,10 @@ springdoc-openapi-starter-webmvc-ui 2.6.0 + + org.springframework.cloud + spring-cloud-starter-config + diff --git a/src/main/resources/application-dev.yaml b/src/main/resources/application-dev.yaml index b882783..bea4b51 100644 --- a/src/main/resources/application-dev.yaml +++ b/src/main/resources/application-dev.yaml @@ -1,7 +1,6 @@ server: port: 0 -eureka: - client: - service-url: - defaultZone: http://localhost:8761/eureka +spring: + config: + import: optional:configserver:http://localhost:8888 diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 2db7e6c..4976542 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,36 +1,5 @@ -info: - application: - name: ${spring.application.name} - version: '@project.version@' - spring-cloud-version: '@spring-cloud.version@' - spring-boot-version: '@project.parent.version@' - -server: - port: ${PORT:8080} - shutdown: graceful - error: - include-message: on_param - include-stacktrace: on_param - spring: application: name: timezone-service - -management: - endpoint: - health: - probes: - enabled: true - -eureka: - client: - register-with-eureka: true - fetch-registry: true - service-url: - defaultZone: http://eureka-service.web:8761/eureka - instance: - instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}} - -springdoc: - swagger-ui: - path: /swagger-ui.html + config: + import: optional:configserver:http://config-service.web:8080