From 3cdfc2d4b97fb88ca71c766f51b590bce1a278dd Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Mon, 30 Sep 2024 22:48:56 +0200 Subject: [PATCH] usage of eureka Signed-off-by: Peter Siegmund --- build.gradle | 1 + src/main/resources/application.yaml | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ef25596..23f6b7b 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,7 @@ dependencies { implementation 'io.grpc:grpc-netty' implementation 'io.netty:netty-all' implementation 'com.nimbusds:nimbus-jose-jwt:9.41.1' + implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' testImplementation 'io.projectreactor:reactor-test' compileOnly 'org.projectlombok:lombok' developmentOnly 'org.springframework.boot:spring-boot-devtools' diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index e4bd203..d807e3a 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,3 +1,7 @@ +eureka: + instance: + instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}} + info: application: name: ${spring.application.name} @@ -37,8 +41,15 @@ spring: firstBackoff: 50ms maxBackoff: 5000ms routes: + - id: eureka-service + uri: lb://eureka-service + predicates: + - Path=/discovery/** + filters: + - StripPrefix=1 + - id: timezone-service - uri: ${TIMEZONE_SERVICE_URI:http://timezone-service.web:8080} + uri: lb://timezone-service predicates: - Path=/v1/timezone/**, /health/timezone filters: