Skip to content

Commit

Permalink
feat($Consul): enable Consul config center
Browse files Browse the repository at this point in the history
enable Consul config center

BREAKING CHANGE: enable Consul config center
  • Loading branch information
johnnymillergh committed Feb 5, 2021
1 parent 289bb1e commit 9887360
Show file tree
Hide file tree
Showing 41 changed files with 153 additions and 180 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.development
port: 8500
zipkin:
base-url: http://maf.zipkin.development:9411
devtools:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: localhost
port: 8500
zipkin:
base-url: http://localhost:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions api-gateway/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.production
port: 8500
zipkin:
base-url: http://maf.zipkin.production:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions api-gateway/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.stage
port: 8500
zipkin:
base-url: http://maf.zipkin.stage:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions api-gateway/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.test
port: 8500
zipkin:
base-url: http://maf.zipkin.test:9411
devtools:
Expand Down
17 changes: 2 additions & 15 deletions api-gateway/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ server:
uri-encoding: @project.build.sourceEncoding@

spring:
application:
name: @project.artifactId@
profiles:
active: @env@
mvc:
Expand All @@ -18,21 +16,10 @@ spring:
probability: 1.0
cloud:
consul:
config:
enabled: true
prefix: config
# `default-context` should be equal to Spring application name
default-context: ${spring.application.name}
profile-separator: "-"
format: YAML
data-key: "data"
watch:
enabled: true
delay: 1000
discovery:
register: true
instance-id: ${spring.cloud.client.hostname}-${spring.cloud.client.ip-address}-${server.port}-${spring.application.name}
service-name: ${spring.application.name}
instance-id: ${spring.cloud.client.hostname}-${spring.cloud.client.ip-address}-${server.port}-@project.artifactId@
service-name: @project.artifactId@
port: ${server.port}
prefer-ip-address: true
ip-address: ${spring.cloud.client.ip-address}
Expand Down
18 changes: 18 additions & 0 deletions api-gateway/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
spring:
application:
name: @project.artifactId@
cloud:
consul:
host: "should-be-passed-by-java-opts"
port: 8500
config:
enabled: true
prefix: config
# `default-context` should be equal to Spring application name
default-context: @project.artifactId@
profile-separator: '::'
format: YAML
data-key: "data"
watch:
enabled: true
delay: 1000
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.development
port: 8500
zipkin:
base-url: http://maf.zipkin.development:9411
devtools:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: localhost
port: 8500
zipkin:
base-url: http://localhost:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions auth-center/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.production
port: 8500
zipkin:
base-url: http://maf.zipkin.production:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions auth-center/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.stage
port: 8500
zipkin:
base-url: http://maf.zipkin.stage:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions auth-center/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.test
port: 8500
zipkin:
base-url: http://maf.zipkin.test:9411
devtools:
Expand Down
20 changes: 3 additions & 17 deletions auth-center/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ server:
uri-encoding: @project.build.sourceEncoding@

spring:
application:
name: @project.artifactId@
profiles:
active: @env@
mvc:
Expand All @@ -30,21 +28,10 @@ spring:
file-size-threshold: 0
cloud:
consul:
config:
enabled: true
prefix: config
# `default-context` should be equal to Spring application name
default-context: ${spring.application.name}
profile-separator: "-"
format: YAML
data-key: "data"
watch:
enabled: true
delay: 1000
discovery:
register: true
instance-id: ${spring.cloud.client.hostname}-${spring.cloud.client.ip-address}-${server.port}-${spring.application.name}
service-name: ${spring.application.name}
instance-id: ${spring.cloud.client.hostname}-${spring.cloud.client.ip-address}-${server.port}-@project.artifactId@
service-name: @project.artifactId@
port: ${server.port}
prefer-ip-address: true
ip-address: ${spring.cloud.client.ip-address}
Expand All @@ -57,7 +44,6 @@ spring:
minIdle: 10
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 10000
min-evictable-idle-time-millis: 600000
max-evictable-idle-time-millis: 900000
validation-query: SELECT 1
Expand Down Expand Up @@ -174,7 +160,7 @@ maf:
- "/*/v2/api-docs/**"
- "/webjars/**"
- "/doc.html"
included-package-for-http-api-scan: ${project.property.base-package}
included-package-for-http-api-scan: ${maf.project-property.base-package}

# Customize JWT configuration for development environment.
jwt:
Expand Down
18 changes: 18 additions & 0 deletions auth-center/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
spring:
application:
name: @project.artifactId@
cloud:
consul:
host: "should-be-passed-by-java-opts"
port: 8500
config:
enabled: true
prefix: config
# `default-context` should be equal to Spring application name
default-context: @project.artifactId@
profile-separator: '::'
format: YAML
data-key: "data"
watch:
enabled: true
delay: 1000
1 change: 1 addition & 0 deletions docker/config/auth-center/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
greeting: "Hello from Consul config center!"
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.development
port: 8500
zipkin:
base-url: http://maf.zipkin.development:9411
devtools:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: localhost
port: 8500
zipkin:
base-url: http://localhost:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions exercise-mis/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.production
port: 8500
zipkin:
base-url: http://maf.zipkin.production:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions exercise-mis/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.stage
port: 8500
zipkin:
base-url: http://maf.zipkin.stage:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions exercise-mis/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.test
port: 8500
zipkin:
base-url: http://maf.zipkin.test:9411
devtools:
Expand Down
17 changes: 3 additions & 14 deletions exercise-mis/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,10 @@ spring:
file-size-threshold: 0
cloud:
consul:
config:
enabled: true
prefix: config
# `default-context` should be equal to Spring application name
default-context: ${spring.application.name}
profile-separator: "-"
format: YAML
data-key: "data"
watch:
enabled: true
delay: 1000
discovery:
register: true
instance-id: ${spring.cloud.client.hostname}-${spring.cloud.client.ip-address}-${server.port}-${spring.application.name}
service-name: ${spring.application.name}
instance-id: ${spring.cloud.client.hostname}-${spring.cloud.client.ip-address}-${server.port}-@project.artifactId@
service-name: @project.artifactId@
port: ${server.port}
prefer-ip-address: true
ip-address: ${spring.cloud.client.ip-address}
Expand Down Expand Up @@ -171,7 +160,7 @@ maf:
- "/*/v2/api-docs/**"
- "/webjars/**"
- "/doc.html"
included-package-for-http-api-scan: ${project.property.base-package}
included-package-for-http-api-scan: ${maf.project-property.base-package}

sftp:
client:
Expand Down
18 changes: 18 additions & 0 deletions exercise-mis/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
spring:
application:
name: @project.artifactId@
cloud:
consul:
host: "should-be-passed-by-java-opts"
port: 8500
config:
enabled: true
prefix: config
# `default-context` should be equal to Spring application name
default-context: @project.artifactId@
profile-separator: '::'
format: YAML
data-key: "data"
watch:
enabled: true
delay: 1000
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.development
port: 8500
zipkin:
base-url: http://maf.zipkin.development:9411
devtools:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: localhost
port: 8500
zipkin:
base-url: http://localhost:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions muscle-mis/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.production
port: 8500
zipkin:
base-url: http://maf.zipkin.production:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions muscle-mis/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.stage
port: 8500
zipkin:
base-url: http://maf.zipkin.stage:9411
devtools:
Expand Down
4 changes: 0 additions & 4 deletions muscle-mis/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
spring:
cloud:
consul:
host: maf.consul-service-registry.test
port: 8500
zipkin:
base-url: http://maf.zipkin.test:9411
devtools:
Expand Down
17 changes: 3 additions & 14 deletions muscle-mis/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,10 @@ spring:
probability: 1.0
cloud:
consul:
config:
enabled: true
prefix: config
# `default-context` should be equal to Spring application name
default-context: ${spring.application.name}
profile-separator: "-"
format: YAML
data-key: "data"
watch:
enabled: true
delay: 1000
discovery:
register: true
instance-id: ${spring.cloud.client.hostname}-${spring.cloud.client.ip-address}-${server.port}-${spring.application.name}
service-name: ${spring.application.name}
instance-id: ${spring.cloud.client.hostname}-${spring.cloud.client.ip-address}-${server.port}-@project.artifactId@
service-name: @project.artifactId@
port: ${server.port}
prefer-ip-address: true
ip-address: ${spring.cloud.client.ip-address}
Expand Down Expand Up @@ -172,7 +161,7 @@ maf:
- "/*/v2/api-docs/**"
- "/webjars/**"
- "/doc.html"
included-package-for-http-api-scan: ${project.property.base-package}
included-package-for-http-api-scan: ${maf.project-property.base-package}

sftp:
client:
Expand Down
Loading

0 comments on commit 9887360

Please sign in to comment.