Skip to content

Commit

Permalink
Modify yaml and pom files for config-server
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim471 committed Jan 15, 2023
1 parent 27c71e6 commit 4103ab7
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 89 deletions.
12 changes: 8 additions & 4 deletions api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-config</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
Expand Down
43 changes: 2 additions & 41 deletions api-gateway/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,7 @@ spring:
application:
name: api-gateway
cloud:
gateway:
routes:
- id: customer-service
uri: lb://customer-service
predicates:
- Path=/api/**
- id: notification-service
uri: lb://notification-service
predicates:
- Path=/api/notification/email
- id: inventory-service
uri: lb://inventory-service
predicates:
- Path=/api/product/**
- id: discovery-server
uri: http://localhost:8761
predicates:
- Path=/eureka/web
filters:
- SetPath=/
- id: discovery-server-static
uri: http://localhost:8761
predicates:
- Path=/eureka/**
security:
oauth2:
resourceserver:
jwt:
issuer-uri: http://192.168.99.100:8080/realms/microservices-realm
server:
port: 8180
logging:
level:
org:
springframework:
cloud:
gateway:
route:
RouteDefinitionRouteLocator: INFO
nodeValue: TRACE
root: INFO
config:
uri: http://localhost:8888


6 changes: 2 additions & 4 deletions config-server/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ spring:
config:
server:
git:
# uri: https://github.com/MaximRom00/Microservices-example
uri: https://github.com/MaximRom00/Config-repo
# search-paths: config-repo
search-paths: config
uri: https://github.com/MaximRom00/Microservices-example
search-paths: config-repo
server:
port: 8888
21 changes: 17 additions & 4 deletions customer-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,27 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-config</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-circuitbreaker-resilience4j</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
Expand Down
25 changes: 8 additions & 17 deletions customer-service/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
spring:
jpa:
hibernate:
ddl-auto: create
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
show-sql: true
database-platform: org.hibernate.dialect.MySQL5Dialect
datasource:
url: jdbc:mysql://${mysql.host}:3306/customerm
password: '12345'
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
application:
name: customer-service
server:
port: 8881
mysql:
host: ${DOCKER_MYSQL_HOST:localhost}
cloud:
config:
uri: http://localhost:8888
rabbitmq:
password: guest
port: '5672'
host: 192.168.99.100
username: guest
12 changes: 8 additions & 4 deletions discovery-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-config</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions discovery-server/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ eureka:
fetch-registry: false
server:
port: 8761
spring:
application:
name: discovery-server
cloud:
config:
uri: http://localhost:8888
9 changes: 8 additions & 1 deletion inventory-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
11 changes: 3 additions & 8 deletions inventory-service/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
server:
port: 8083
spring:
data:
mongodb:
uri: mongodb://${mongo.host}/inventory-service
application:
name: inventory-service
mongo:
host: ${DOCKER_MONGO_HOST:localhost:27017}

cloud:
config:
uri: http://localhost:8888
18 changes: 14 additions & 4 deletions notification-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,20 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-config</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<version>3.0.0</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
10 changes: 8 additions & 2 deletions notification-service/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
server:
port: 0
spring:
application:
name: notification-service
cloud:
config:
uri: http://localhost:8888
rabbitmq:
password: guest
port: '5672'
host: 192.168.99.100
username: guest

0 comments on commit 4103ab7

Please sign in to comment.