-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨refactor: centralize configuration management with shared yaml files
- Loading branch information
Adnane Miliari
committed
Nov 27, 2024
1 parent
80b45eb
commit bb3f9d3
Showing
33 changed files
with
258 additions
and
697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<parent> | ||
<artifactId>demo-microservices</artifactId> | ||
<groupId>dev.nano</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>common</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-jpa</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.micrometer</groupId> | ||
<artifactId>micrometer-tracing-bridge-brave</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.zipkin.reporter2</groupId> | ||
<artifactId>zipkin-reporter-brave</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-actuator</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
management: | ||
observations: | ||
key-values: | ||
application: ${spring.application.name} | ||
tracing: | ||
sampling: | ||
probability: 1.0 | ||
enabled: true | ||
zipkin: | ||
tracing: | ||
endpoint: http://localhost:9411/api/v2/spans | ||
endpoints: | ||
web: | ||
exposure: | ||
include: "*" | ||
endpoint: | ||
health: | ||
show-details: always | ||
|
||
spring: | ||
datasource: | ||
url: jdbc:postgresql://localhost:5432/${spring.application.name} | ||
username: postgres | ||
password: password | ||
jpa: | ||
hibernate: | ||
ddl-auto: create-drop | ||
properties: | ||
hibernate: | ||
dialect: org.hibernate.dialect.PostgreSQLDialect | ||
format_sql: true | ||
show-sql: true | ||
open-in-view: false | ||
rabbitmq: | ||
addresses: localhost:5672 | ||
|
||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: http://localhost:8761/eureka | ||
fetch-registry: true | ||
register-with-eureka: true | ||
|
||
logging: | ||
pattern: | ||
correlation: "[${spring.application.name:},%X{traceId:-},%X{spanId:-}]" | ||
level: "%5p ${logging.pattern.correlation} %c{1.} : %m%n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
management: | ||
zipkin: | ||
tracing: | ||
endpoint: http://zipkin:9411/api/v2/spans | ||
|
||
spring: | ||
datasource: | ||
url: jdbc:postgresql://postgres:5432/${spring.application.name} | ||
username: miliariadnane | ||
password: password | ||
rabbitmq: | ||
addresses: rabbitmq:5672 | ||
|
||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: http://eureka-server:8761/eureka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
management: | ||
zipkin: | ||
tracing: | ||
endpoint: http://zipkin:9411/api/v2/spans | ||
|
||
spring: | ||
datasource: | ||
url: jdbc:postgresql://demo-microservices.csetxdk14qax.us-east-1.rds.amazonaws.com:5432/${spring.application.name} | ||
username: ${DB_USERNAME} | ||
password: ${DB_PASSWORD} | ||
rabbitmq: | ||
addresses: rabbitmq:5672 | ||
jpa: | ||
hibernate: | ||
ddl-auto: update | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
management: | ||
zipkin: | ||
tracing: | ||
endpoint: http://zipkin:9411/api/v2/spans | ||
|
||
spring: | ||
datasource: | ||
url: jdbc:postgresql://postgres:5432/${spring.application.name} | ||
username: miliariadnane | ||
password: password | ||
rabbitmq: | ||
addresses: rabbitmq:5672 | ||
|
||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: http://eureka-server:8761/eureka | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,12 @@ | ||
#Server | ||
server: | ||
port: 8001 | ||
servlet: | ||
context-path: /customer | ||
error: | ||
include-message: always | ||
#Management | ||
management: | ||
endpoints: | ||
web: | ||
exposure: | ||
include: "*" | ||
endpoint: | ||
health: | ||
show-details: always | ||
#Spring | ||
include-message: always | ||
|
||
spring: | ||
application: | ||
name: customer | ||
datasource: | ||
url: jdbc:postgresql://localhost:5432/customer | ||
username: postgres | ||
password: password | ||
zipkin: | ||
base-url: http://localhost:9411 | ||
rabbitmq: | ||
addresses: localhost:5672 # not http, because is a message queue protocol | ||
jpa: | ||
hibernate: | ||
ddl-auto: create-drop | ||
properties: | ||
hibernate: | ||
dialect: org.hibernate.dialect.PostgreSQLDialect | ||
format_sql: true | ||
show-sql: true | ||
#Eureka-Client | ||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: http://localhost:8761/eureka | ||
fetch-registry: true | ||
register-with-eureka: true | ||
logging: | ||
pattern: | ||
# Logging pattern containing traceId and spanId; no longer provided through Sleuth by default | ||
level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]" | ||
|
||
config: | ||
import: classpath:shared-application-${spring.profiles.active}.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.