From d1453e1d9038571d18ee1672435f04ce228d270f Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Mon, 14 Oct 2024 23:42:19 +0200 Subject: [PATCH] new config settings Signed-off-by: Peter Siegmund --- build.gradle | 2 + src/main/resources/application-dev.yaml | 7 ---- src/main/resources/application.yml | 39 ------------------ src/main/resources/bootstrap.yml | 17 ++++++++ .../resources/configurations/application.yml | 41 +++++++++++++------ 5 files changed, 47 insertions(+), 59 deletions(-) delete mode 100644 src/main/resources/application-dev.yaml delete mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/bootstrap.yml diff --git a/build.gradle b/build.gradle index 8df75ee..6977379 100644 --- a/build.gradle +++ b/build.gradle @@ -32,6 +32,8 @@ dependencies { implementation 'org.springframework.cloud:spring-cloud-config-server' implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' + implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' + implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' diff --git a/src/main/resources/application-dev.yaml b/src/main/resources/application-dev.yaml deleted file mode 100644 index 8c96e48..0000000 --- a/src/main/resources/application-dev.yaml +++ /dev/null @@ -1,7 +0,0 @@ -server: - port: 8888 - -eureka: - client: - service-url: - defaultZone: http://localhost:8761/eureka diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml deleted file mode 100644 index 7a37ad3..0000000 --- a/src/main/resources/application.yml +++ /dev/null @@ -1,39 +0,0 @@ -eureka: - client: - register-with-eureka: true - fetch-registry: true - service-url: - defaultZone: http://eureka-service.web:8761/eureka - -info: - application: - name: ${spring.application.name} - version: '@project.version@' - spring-cloud-version: '@spring-cloud.version@' - spring-boot-version: '@project.parent.version@' - -management: - endpoint: - health: - probes: - enabled: true - -server: - port: ${PORT:8080} - shutdown: graceful - error: - include-message: on_param - include-stacktrace: on_param - -sentry: - dsn: https://354321d371291036cffcdb5b1a72fd6e@o394865.ingest.us.sentry.io/4507718826262528 - environment: edge-service - - # Set traces_sample_rate to 1.0 to capture 100% - # of transactions for tracing. - # We recommend adjusting this value in production. - tracesSampleRate: 1.0 - -spring: - application: - name: config-service diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..e11f9e4 --- /dev/null +++ b/src/main/resources/bootstrap.yml @@ -0,0 +1,17 @@ +logging: + level: + com: + netflix: + discovery: off + +server: + port: ${PORT:8888} + +spring: + application: + name: config-service + cloud: + config: + server: + native: + search-locations: classpath:/configurations diff --git a/src/main/resources/configurations/application.yml b/src/main/resources/configurations/application.yml index 7d2d20e..acd5aea 100644 --- a/src/main/resources/configurations/application.yml +++ b/src/main/resources/configurations/application.yml @@ -1,3 +1,10 @@ +eureka: + client: + register-with-eureka: true + fetch-registry: true + service-url: + defaultZone: ${EUREKA-URI:http://localhost:8761/eureka} + info: application: name: ${spring.application.name} @@ -5,6 +12,27 @@ info: spring-cloud-version: '@spring-cloud.version@' spring-boot-version: '@project.parent.version@' +logging: + level: + com: + netflix: + discovery: ERROR + +management: + endpoint: + health: + probes: + enabled: true + +sentry: + dsn: https://354321d371291036cffcdb5b1a72fd6e@o394865.ingest.us.sentry.io/4507718826262528 + environment: edge-service + + # Set traces_sample_rate to 1.0 to capture 100% + # of transactions for tracing. + # We recommend adjusting this value in production. + tracesSampleRate: 1.0 + server: port: ${PORT:8080} shutdown: graceful @@ -12,19 +40,6 @@ server: include-message: on_param include-stacktrace: on_param -management: - endpoint: - health: - probes: - enabled: true - -eureka: - client: - register-with-eureka: true - fetch-registry: true - service-url: - defaultZone: http://eureka-service.web:8761/eureka - springdoc: swagger-ui: path: /swagger-ui.html