Skip to content

Commit

Permalink
Config and discovery servers run now
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoozhoo committed Sep 27, 2024
1 parent f1e1e2a commit a187834
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 25 deletions.
2 changes: 1 addition & 1 deletion spring-cloud-config-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<!-- Third-party librairies -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
server:
port: 8888
spring:
application:
name: config-server
Expand All @@ -8,3 +10,7 @@ spring:
git:
uri: https://github.com/zhoozhoo/spring-cloud-examples-config.git
force-pull: true
eureka:
client:
serviceUrl:
defaultZone: ${EUREKA_URI:http://localhost:8761}/eureka/
8 changes: 2 additions & 6 deletions spring-cloud-discovery-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@
<!-- Spring Cloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>

<!-- Other Spring-->
Expand Down
17 changes: 17 additions & 0 deletions spring-cloud-discovery-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
server:
port: 8761
spring:
application:
name: discovery-server
config:
import: optional:configserver:${CONFIG_SERVER_URL:http://localhost:8888/}
eureka:
client:
register-with-eureka: false
fetch-registry: false
---
spring:
config:
activate:
on-profile: docker
import: configserver:http://config-server:8888
15 changes: 0 additions & 15 deletions spring-cloud-discovery-server/src/main/resources/bootstrap.yml

This file was deleted.

16 changes: 13 additions & 3 deletions spring-cloud-room-reservation-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

<!-- Spring Cloud -->
Expand Down Expand Up @@ -94,5 +94,15 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
4 changes: 4 additions & 0 deletions spring-cloud-room-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<!-- Third parties -->
<dependency>
Expand Down
10 changes: 10 additions & 0 deletions spring-cloud-room-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ spring:
name: room-service
config:
import: optional:configserver:${CONFIG_SERVER_URL:http://localhost:8888/}
cloud:
config:
discovery:
enabled: true
serviceId: config-server
fail-fast: true
eureka:
client:
serviceUrl:
defaultZone: ${EUREKA_URI:http://localhost:8761}/eureka/
---
spring:
config:
Expand Down

0 comments on commit a187834

Please sign in to comment.