From 3329b60d4fbf475b8f7407751efba5d7312fb688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20V=C3=A1=C5=88a?= Date: Fri, 12 Jul 2024 17:25:20 +0200 Subject: [PATCH] Remove @EnableDiscoveryClient annotation According to the Official Spring Cloud docs, it is not required anymore: "@EnableDiscoveryClient is no longer required. You can put a DiscoveryClient implementation on the classpath to cause the Spring Boot application to register with the service discovery server." See: https://docs.spring.io/spring-cloud-commons/reference/4.1/spring-cloud-commons/common-abstractions.html#discovery-client Closes gh-18 --- .../src/main/java/org/example/teahouse/sba/SbaApplication.java | 2 -- .../java/org/example/teahouse/tea/TeaServiceApplication.java | 2 -- .../org/example/teahouse/tealeaf/TealeafServiceApplication.java | 2 -- .../org/example/teahouse/water/WaterServiceApplication.java | 2 -- 4 files changed, 8 deletions(-) diff --git a/spring-boot-admin/src/main/java/org/example/teahouse/sba/SbaApplication.java b/spring-boot-admin/src/main/java/org/example/teahouse/sba/SbaApplication.java index 66810a2..033eec1 100644 --- a/spring-boot-admin/src/main/java/org/example/teahouse/sba/SbaApplication.java +++ b/spring-boot-admin/src/main/java/org/example/teahouse/sba/SbaApplication.java @@ -6,12 +6,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; @EnableAdminServer -@EnableDiscoveryClient @SpringBootApplication @PropertySource("classpath:build.properties") @Import({CommonActuatorConfig.class}) diff --git a/tea-service/src/main/java/org/example/teahouse/tea/TeaServiceApplication.java b/tea-service/src/main/java/org/example/teahouse/tea/TeaServiceApplication.java index aab9de1..20d4207 100644 --- a/tea-service/src/main/java/org/example/teahouse/tea/TeaServiceApplication.java +++ b/tea-service/src/main/java/org/example/teahouse/tea/TeaServiceApplication.java @@ -3,13 +3,11 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.PropertySource; @EnableFeignClients -@EnableDiscoveryClient @SpringBootApplication @PropertySource("classpath:build.properties") @ComponentScan(basePackages = { "org.example.teahouse" }) diff --git a/tealeaf-service/src/main/java/org/example/teahouse/tealeaf/TealeafServiceApplication.java b/tealeaf-service/src/main/java/org/example/teahouse/tealeaf/TealeafServiceApplication.java index 14701ed..cf78926 100644 --- a/tealeaf-service/src/main/java/org/example/teahouse/tealeaf/TealeafServiceApplication.java +++ b/tealeaf-service/src/main/java/org/example/teahouse/tealeaf/TealeafServiceApplication.java @@ -3,11 +3,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.PropertySource; -@EnableDiscoveryClient @SpringBootApplication @PropertySource("classpath:build.properties") @ComponentScan(basePackages = { "org.example.teahouse" }) diff --git a/water-service/src/main/java/org/example/teahouse/water/WaterServiceApplication.java b/water-service/src/main/java/org/example/teahouse/water/WaterServiceApplication.java index 822152f..f694daa 100644 --- a/water-service/src/main/java/org/example/teahouse/water/WaterServiceApplication.java +++ b/water-service/src/main/java/org/example/teahouse/water/WaterServiceApplication.java @@ -3,11 +3,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.PropertySource; -@EnableDiscoveryClient @SpringBootApplication @PropertySource("classpath:build.properties") @ComponentScan(basePackages = { "org.example.teahouse" })