use of external settings

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2024-10-15 00:16:36 +02:00
parent f9b73fc267
commit 0d4f750c65
5 changed files with 17 additions and 104 deletions

View File

@@ -1,12 +1,7 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Application" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot"> <configuration default="false" name="Application" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<option name="ALTERNATIVE_JRE_PATH" value="temurin-21" /> <option name="ALTERNATIVE_JRE_PATH" value="temurin-21" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" /> <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<envs>
<env name="TIMEZONE_SERVICE_URI" value="http://localhost:8085" />
<env name="GOOGLE_SERVICE_URI" value="http://localhost:8096" />
</envs>
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" /> <option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
<module name="edge-service.main" /> <module name="edge-service.main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="dev.mars3142.fhq.Application" /> <option name="SPRING_BOOT_MAIN_CLASS" value="dev.mars3142.fhq.Application" />

View File

@@ -39,6 +39,7 @@ dependencies {
implementation 'com.google.cloud:spring-cloud-gcp-starter' implementation 'com.google.cloud:spring-cloud-gcp-starter'
implementation 'com.google.auth:google-auth-library-oauth2-http' implementation 'com.google.auth:google-auth-library-oauth2-http'
implementation 'io.grpc:grpc-netty' implementation 'io.grpc:grpc-netty'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
implementation 'io.netty:netty-all' implementation 'io.netty:netty-all'
implementation 'com.nimbusds:nimbus-jose-jwt:9.41.2' implementation 'com.nimbusds:nimbus-jose-jwt:9.41.2'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
@@ -46,6 +47,7 @@ dependencies {
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-api:2.6.0' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-api:2.6.0'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
testImplementation 'io.projectreactor:reactor-test' testImplementation 'io.projectreactor:reactor-test'
compileOnly 'org.projectlombok:lombok' compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools' developmentOnly 'org.springframework.boot:spring-boot-devtools'

View File

@@ -1,14 +0,0 @@
server:
port: 8090
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka
logging:
level:
org:
springframework:
cloud:
gateway: TRACE

View File

@@ -1,85 +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: edge-service
cloud:
gateway:
default-filters:
- name: Retry
args:
retries: 3
methods: GET
series: SERVER_ERROR
exceptions: java.io.IOException, java.util.concurrent.TimeoutException
backoff:
firstBackoff: 50ms
maxBackoff: 5000ms
discovery:
locator:
enabled: false
routes:
- id: edge
uri: lb://edge-service
predicates:
- Path=/v3/api-docs/**
filters:
- RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/v3/api-docs
- id: timezone-service
uri: lb://timezone-service
predicates:
- Path=/v1/timezone/**, /health/timezone, /timezone/v3/api-docs
filters:
- RewritePath=/health/timezone, /actuator/health
- RewritePath=/timezone/(?<segment>.*), /$\{segment}
- id: google-service
uri: ${GOOGLE_SERVICE_URI:http://google-service.web:8080}
predicates:
- Path=/v1/account/**, /health/google, /google/v3/api-docs
filters:
- RewritePath=/health/google, /actuator/health
- RewritePath=/google/(?<segment>.*), /$\{segment}
- id: token-service
uri: ${BACKEND_SERVICE_URI:http://backend-service.web:8080}
predicates:
- Path=/v1/token/**, /health/backend, /token/v3/api-docs
filters:
- RewritePath=/health/backend, /actuator/health
- RewritePath=/token/(?<segment>.*), /$\{segment}

View File

@@ -0,0 +1,15 @@
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: ${EUREKA-URI:http://localhost:8761/eureka}
spring:
application:
name: edge-service
cloud:
config:
discovery:
enabled: true
serviceId: config-service