From a2aa347a4d62bf53037637d1baed83477a75eb72 Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Mon, 30 Sep 2024 22:39:28 +0200 Subject: [PATCH] implement eureka Signed-off-by: Peter Siegmund --- pom.xml | 12 ++++++++++++ src/main/resources/application-dev.yaml | 7 +++++++ src/main/resources/application.yaml | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/pom.xml b/pom.xml index d6db6c3..0aa33a3 100644 --- a/pom.xml +++ b/pom.xml @@ -29,6 +29,7 @@ 17 1.2.4 + 2023.0.3 @@ -73,6 +74,10 @@ junit-platform-runner test + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + @@ -83,6 +88,13 @@ pom import + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + diff --git a/src/main/resources/application-dev.yaml b/src/main/resources/application-dev.yaml index 0cc0712..d96ccbb 100644 --- a/src/main/resources/application-dev.yaml +++ b/src/main/resources/application-dev.yaml @@ -1,2 +1,9 @@ server: port: 8085 + +eureka: + client: + service-url: + defaultZone: http://localhost:8761/eureka + instance: + instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 413cd7d..cbfd0e8 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -15,3 +15,10 @@ server: spring: application: name: timezone-service + +eureka: + client: + register-with-eureka: true + fetch-registry: true + service-url: + defaultZone: http://eureka-service.web:8761/eureka