Skip to content

Commit

Permalink
perf($Consul): reduce duplicate application configuration YAML files
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Feb 3, 2022
1 parent f883d81 commit a9c3237
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,36 @@ server:
context-path:

spring:
application:
name: @project.parent.artifactId@
profiles:
active: @environment@
config:
import: "consul:${spring.cloud.consul.host}:${spring.cloud.consul.port}"
cloud:
# https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/index.html#spring-cloud-consul-config
consul:
host: "should-be-passed-by-java-opts"
port: 8500
config:
# `default-context` should not be modified, keeps "application" for common configuration.
# Properties in the config/application folder are applicable to all applications using consul for configuration.
profile-separator: "::"
format: YAML
data-key: "data"
watch:
enabled: true
delay: 1000
prefixes:
- config
discovery:
register: true
instance-id: ${spring.application.name}-${spring.cloud.client.hostname}-${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
service-name: ${spring.application.name}
port: ${server.port}
prefer-ip-address: true
ip-address: ${spring.cloud.client.ip-address}
health-check-critical-timeout: 15s
mvc:
throw-exception-if-no-handler-found: true
jackson:
Expand All @@ -29,16 +57,6 @@ spring:
# `file-size-threshold` specifies the size threshold after which files will be written to disk.
# The default is 0. We set it as 0 too.
file-size-threshold: 0
cloud:
consul:
discovery:
register: true
instance-id: ${spring.application.name}-${spring.cloud.client.hostname}-${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
service-name: ${spring.application.name}
port: ${server.port}
prefer-ip-address: true
ip-address: ${spring.cloud.client.ip-address}
health-check-critical-timeout: 15s
datasource:
type: com.alibaba.druid.pool.DruidDataSource
dynamic:
Expand Down Expand Up @@ -148,6 +166,8 @@ mybatis-plus:

logging:
config: classpath:logback-configuration/logback-${spring.profiles.active}.xml
level:
org.springframework.boot.context.config: TRACE

maf:
project-properties:
Expand Down
19 changes: 0 additions & 19 deletions auth-center/auth-center-bootstrap/src/main/resources/bootstrap.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ redis:
port: 6379
password: maf@redis

minio:
endpoint: http://maf-minio
port: 9000
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf

maf:
configuration:
swagger-enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ redis:
port: 6380
password: maf@redis

logging:
level:
com.baomidou: DEBUG
com.jmsoftware: DEBUG
minio:
endpoint: http://localhost
port: 9000
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf

maf:
configuration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ redis:
port: 6379
password: maf@redis

minio:
endpoint: http://maf-minio
port: 9000
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf

maf:
configuration:
swagger-enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ redis:
port: 6379
password: maf@redis

minio:
endpoint: http://maf-minio
port: 9000
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf

maf:
configuration:
swagger-enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ redis:
port: 6379
password: maf@redis

minio:
endpoint: http://maf-minio
port: 9000
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf

maf:
configuration:
swagger-enabled: true

0 comments on commit a9c3237

Please sign in to comment.