Files
spring-boot-microservices-p…/cloud-2026-upgrade/steps/04-config-notify.patch
T

55 lines
2.0 KiB
Diff

diff --git a/config-server/pom.xml b/config-server/pom.xml
index 5d4c296..4c66381 100644
--- a/config-server/pom.xml
+++ b/config-server/pom.xml
@@ -18,6 +18,21 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
+ <!-- POST /monitor, and (without Spring Cloud Bus on the classpath) the new HttpPropertyPathNotifier -->
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-config-monitor</artifactId>
+ </dependency>
+ <!-- the notifier needs a DiscoveryClient bean ... -->
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+ </dependency>
+ <!-- ... and a RestClient.Builder bean -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-restclient</artifactId>
+ </dependency>
</dependencies>
<build>
diff --git a/config-server/src/main/resources/application.yml b/config-server/src/main/resources/application.yml
index 1e4ae43..2df2b43 100644
--- a/config-server/src/main/resources/application.yml
+++ b/config-server/src/main/resources/application.yml
@@ -10,3 +10,10 @@ spring:
search-locations: classpath:/config
server:
port: 8888
+eureka:
+ client:
+ service-url:
+ defaultZone: ${EUREKA_URL:http://localhost:8761/eureka}
+ instance:
+ hostname: ${EUREKA_HOSTNAME:localhost}
+ instance-id: ${spring.application.name}:${server.port}
diff --git a/config-server/src/main/resources/config/application.yml b/config-server/src/main/resources/config/application.yml
index a1c6d11..56dedce 100644
--- a/config-server/src/main/resources/config/application.yml
+++ b/config-server/src/main/resources/config/application.yml
@@ -3,7 +3,7 @@ management:
endpoints:
web:
exposure:
- include: health,info,circuitbreakers
+ include: health,info,circuitbreakers,refresh
tracing:
sampling:
probability: 1.0