Skip to content

Commit 7f85459

Browse files
committed
remove spring cloud config and add apollo
1 parent 24bf550 commit 7f85459

File tree

47 files changed

+112
-262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+112
-262
lines changed

build.gradle

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
repositories {
66
mavenLocal()
77
maven{
8-
url 'http://182.92.218.12:8077/nexus/content/groups/public/'
8+
url 'http://localhost:8077/nexus/content/groups/public/'
99
}
1010
}
1111
dependencies {
@@ -54,6 +54,7 @@ configure(allprojects) { project ->
5454
ext.hutoolVersion = "3.0.3"
5555
ext.swagger2Version = "2.6.1"
5656
ext.logbackkafkaVersion = "0.1.0"
57+
ext.apolloclientVersion = "0.8.0"
5758

5859
apply plugin: "java"
5960
apply plugin: 'idea'
@@ -217,9 +218,9 @@ project("xbin-store-cloud-service-admin") {
217218
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
218219
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
219220
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
220-
compile("org.springframework.cloud:spring-cloud-starter-config")
221221
compile("org.springframework.cloud:spring-cloud-starter-security")
222222
compile("org.springframework.cloud:spring-cloud-starter-oauth2")
223+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
223224
}
224225

225226
bootRepackage {
@@ -234,7 +235,7 @@ project("xbin-store-cloud-web-admin") {
234235
compile(project(":xbin-store-cloud-service-admin-api"))
235236
compile("org.springframework.boot:spring-boot-starter-web")
236237
compile("org.springframework.cloud:spring-cloud-starter-eureka")
237-
compile("org.springframework.cloud:spring-cloud-starter-config")
238+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
238239
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
239240
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
240241
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
@@ -264,7 +265,7 @@ project("xbin-store-cloud-service-search") {
264265
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
265266
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
266267
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
267-
compile("org.springframework.cloud:spring-cloud-starter-config")
268+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
268269
compile("org.springframework.data:spring-data-solr")
269270
}
270271
}
@@ -275,7 +276,7 @@ project("xbin-store-cloud-web-search") {
275276
compile(project(":xbin-store-cloud-service-search-api"))
276277
compile("org.springframework.boot:spring-boot-starter-web")
277278
compile("org.springframework.cloud:spring-cloud-starter-eureka")
278-
compile("org.springframework.cloud:spring-cloud-starter-config")
279+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
279280
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
280281
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
281282
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
@@ -304,7 +305,7 @@ project("xbin-store-cloud-service-portal") {
304305
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
305306
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
306307
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
307-
compile("org.springframework.cloud:spring-cloud-starter-config")
308+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
308309
// compile("org.springframework.data:spring-data-redis") //暂时不使用
309310
compile("cn.binux:spring-boot-starter-redis:${springBootRedisVersion}")
310311
}
@@ -316,7 +317,7 @@ project("xbin-store-cloud-web-portal") {
316317
compile(project(":xbin-store-cloud-service-portal-api"))
317318
compile("org.springframework.boot:spring-boot-starter-web")
318319
compile("org.springframework.cloud:spring-cloud-starter-eureka")
319-
compile("org.springframework.cloud:spring-cloud-starter-config")
320+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
320321
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
321322
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
322323
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
@@ -345,7 +346,7 @@ project("xbin-store-cloud-service-item") {
345346
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
346347
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
347348
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
348-
compile("org.springframework.cloud:spring-cloud-starter-config")
349+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
349350
// compile("org.springframework.data:spring-data-redis") //暂时不使用
350351
compile("cn.binux:spring-boot-starter-redis:${springBootRedisVersion}")
351352
compile("org.freemarker:freemarker:2.3.9")
@@ -358,7 +359,7 @@ project("xbin-store-cloud-web-item") {
358359
compile(project(":xbin-store-cloud-service-item-api"))
359360
compile("org.springframework.boot:spring-boot-starter-web")
360361
compile("org.springframework.cloud:spring-cloud-starter-eureka")
361-
compile("org.springframework.cloud:spring-cloud-starter-config")
362+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
362363
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
363364
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
364365
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
@@ -388,7 +389,7 @@ project("xbin-store-cloud-service-cart") {
388389
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
389390
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
390391
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
391-
compile("org.springframework.cloud:spring-cloud-starter-config")
392+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
392393
// compile("org.springframework.data:spring-data-redis") //暂时不使用
393394
compile("cn.binux:spring-boot-starter-redis:${springBootRedisVersion}")
394395
compile("org.freemarker:freemarker:2.3.9")
@@ -401,7 +402,7 @@ project("xbin-store-cloud-web-cart") {
401402
compile(project(":xbin-store-cloud-service-cart-api"))
402403
compile("org.springframework.boot:spring-boot-starter-web")
403404
compile("org.springframework.cloud:spring-cloud-starter-eureka")
404-
compile("org.springframework.cloud:spring-cloud-starter-config")
405+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
405406
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
406407
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
407408
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
@@ -431,7 +432,7 @@ project("xbin-store-cloud-service-notify") {
431432
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
432433
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
433434
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
434-
compile("org.springframework.cloud:spring-cloud-starter-config")
435+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
435436
// compile("org.springframework.data:spring-data-redis") //暂时不使用
436437
compile("cn.binux:spring-boot-starter-redis:${springBootRedisVersion}")
437438
}
@@ -455,7 +456,7 @@ project("xbin-store-cloud-service-sso") {
455456
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
456457
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
457458
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
458-
compile("org.springframework.cloud:spring-cloud-starter-config")
459+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
459460
// compile("org.springframework.data:spring-data-redis") //暂时不使用
460461
compile("cn.binux:spring-boot-starter-redis:${springBootRedisVersion}")
461462
compile("org.freemarker:freemarker:2.3.9")
@@ -469,7 +470,7 @@ project("xbin-store-cloud-web-sso") {
469470
compile(project(":xbin-store-cloud-service-notify-api"))
470471
compile("org.springframework.boot:spring-boot-starter-web")
471472
compile("org.springframework.cloud:spring-cloud-starter-eureka")
472-
compile("org.springframework.cloud:spring-cloud-starter-config")
473+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
473474
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
474475
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
475476
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
@@ -500,7 +501,7 @@ project("xbin-store-cloud-service-order") {
500501
compile("org.springframework.cloud:spring-cloud-starter-zipkin")
501502
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
502503
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
503-
compile("org.springframework.cloud:spring-cloud-starter-config")
504+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
504505
// compile("org.springframework.data:spring-data-redis") //暂时不使用
505506
compile("cn.binux:spring-boot-starter-redis:${springBootRedisVersion}")
506507
compile("org.freemarker:freemarker:2.3.9")
@@ -516,7 +517,7 @@ project("xbin-store-cloud-web-order") {
516517
compile(project(":xbin-store-cloud-service-cart-api"))
517518
compile("org.springframework.boot:spring-boot-starter-web")
518519
compile("org.springframework.cloud:spring-cloud-starter-eureka")
519-
compile("org.springframework.cloud:spring-cloud-starter-config")
520+
compile("com.ctrip.framework.apollo:apollo-client:${apolloclientVersion}")
520521
compile("org.springframework.cloud:spring-cloud-starter-hystrix")
521522
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp")
522523
compile("org.springframework.cloud:spring-cloud-starter-zipkin")

xbin-store-cloud-service-admin/src/main/java/cn/binux/XbinStoreServiceAdminApplication.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
import org.springframework.boot.autoconfigure.SpringBootApplication;
66
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
77
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
8+
import org.springframework.context.annotation.Configuration;
89
import org.springframework.transaction.annotation.EnableTransactionManagement;
910

1011
@SpringBootApplication
1112
@EnableDiscoveryClient
1213
@EnableHystrix
1314
@EnableTransactionManagement
15+
@Configuration
16+
//@EnableApolloConfig
1417
@MapperScan(basePackages = "cn.binux.mapper")
1518
public class XbinStoreServiceAdminApplication {
1619

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app.id=xbin-store-cloud-service-admin
Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
druid:
2-
url: jdbc:mysql://localhost:3306/xbin_store?characterEncoding=utf-8
3-
driver-class: com.mysql.jdbc.Driver
4-
username: root
5-
password: OZo+t9QET+ctzd5Esn9q0GJP5hXtWWIKEsX8c4/w6z4C4AnxrwpvySNgBS89XdazOavjXXZp0oeZtQ3P9lLGEA==
6-
initial-size: 1
7-
min-idle: 1
8-
max-active: 20
9-
test-on-borrow: true
10-
max-wait: 60000
11-
time-between-eviction-runs-millis: 60000
12-
min-evictable-idle-time-millis: 300000
13-
validation-query: SELECT 1 FROM DUAL
14-
test-While-Idle: true
15-
test-on-return: false
16-
pool-prepared-statements: false
17-
max-pool-prepared-statement-per-connection-size: 20
18-
filters: stat,wall,log4j,config
19-
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000;config.decrypt=true
20-
monitor:
21-
enabled: fales
22-
druid-stat-view: /druid/*
23-
druid-web-stat-filter: /*
24-
allow: 219.230.50.107,127.0.0.1
25-
deny: 192.168.1.73
26-
login-username: admin
27-
login-password: 123456
28-
exclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
29-
reset-enable: false
30-
mybatis:
31-
type-aliases-package: cn.binux.pojo
32-
mapper-locations: classpath:mapper/*.xml
33-
34-
35-
pagehelper:
36-
helperDialect: mysql
37-
reasonable: true
38-
supportMethodsArguments: true
39-
params: count=countSql
40-
41-
# swagger2
42-
swagger2.package: cn.binux.admin.service
43-
44-
# Redis
45-
redisKey:
46-
# 缓存时间 默认半小时
47-
expire_time: 1800
48-
prefix:
49-
# 首页广告
50-
index_ad: 'INDEX_AD'
1+
#druid:
2+
# url: jdbc:mysql://localhost:3306/xbin_store?characterEncoding=utf-8
3+
# driver-class: com.mysql.jdbc.Driver
4+
# username: root
5+
# password: OZo+t9QET+ctzd5Esn9q0GJP5hXtWWIKEsX8c4/w6z4C4AnxrwpvySNgBS89XdazOavjXXZp0oeZtQ3P9lLGEA==
6+
# initial-size: 1
7+
# min-idle: 1
8+
# max-active: 20
9+
# test-on-borrow: true
10+
# max-wait: 60000
11+
# time-between-eviction-runs-millis: 60000
12+
# min-evictable-idle-time-millis: 300000
13+
# validation-query: SELECT 1 FROM DUAL
14+
# test-While-Idle: true
15+
# test-on-return: false
16+
# pool-prepared-statements: false
17+
# max-pool-prepared-statement-per-connection-size: 20
18+
# filters: stat,wall,log4j,config
19+
# connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000;config.decrypt=true
20+
# monitor:
21+
# enabled: fales
22+
# druid-stat-view: /druid/*
23+
# druid-web-stat-filter: /*
24+
# allow: 219.230.50.107,127.0.0.1
25+
# deny: 192.168.1.73
26+
# login-username: admin
27+
# login-password: 123456
28+
# exclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
29+
# reset-enable: false
30+
#mybatis:
31+
# type-aliases-package: cn.binux.pojo
32+
# mapper-locations: classpath:mapper/*.xml
33+
#
34+
#
35+
#pagehelper:
36+
# helperDialect: mysql
37+
# reasonable: true
38+
# supportMethodsArguments: true
39+
# params: count=countSql
40+
#
41+
## swagger2
42+
#swagger2.package: cn.binux.admin.service
43+
#
44+
## Redis
45+
#redisKey:
46+
# # 缓存时间 默认半小时
47+
# expire_time: 1800
48+
# prefix:
49+
# # 首页广告
50+
# index_ad: 'INDEX_AD'

xbin-store-cloud-service-admin/src/main/resources/bootstrap.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
spring:
22
application:
3-
name: @project.artifactId@
4-
cloud:
5-
config:
6-
label: master
7-
profile: @profile@
8-
discovery:
9-
enabled: true
10-
service-id: config-server
11-
name: xbin-store-cloud-admin
12-
rabbitmq:
13-
host: localhost
14-
port: 5672
15-
username: guest
16-
password: guest
3+
name: xbin-store-cloud-service-admin
174

185
security.basic.enabled: false
196

xbin-store-cloud-service-cart/src/main/java/cn/binux/XbinStoreServiceCartApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
@Configuration
1616
@SpringBootApplication
1717
@EnableDiscoveryClient
18+
//@EnableApolloConfig
1819
@EnableTransactionManagement
1920
@MapperScan(basePackages = "cn.binux.mapper")
2021
public class XbinStoreServiceCartApplication {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app.id=xbin-store-cloud-service-cart

xbin-store-cloud-service-cart/src/main/resources/bootstrap.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
spring:
22
application:
33
name: xbin-store-cloud-service-cart
4-
cloud:
5-
config:
6-
label: master
7-
profile: dev
8-
discovery:
9-
enabled: true
10-
service-id: config-server
11-
name: xbin-store-cloud-cart
12-
rabbitmq:
13-
host: localhost
14-
port: 5672
15-
username: guest
16-
password: guest
174

185
security.basic.enabled: false
196

xbin-store-cloud-service-item/src/main/java/cn/binux/XbinStoreServiceItemApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
@Configuration
1616
@SpringBootApplication
1717
@EnableDiscoveryClient
18+
//@EnableApolloConfig
1819
@EnableTransactionManagement
1920
@MapperScan(basePackages = "cn.binux.mapper")
2021
public class XbinStoreServiceItemApplication {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app.id=xbin-store-cloud-service-item

xbin-store-cloud-service-item/src/main/resources/bootstrap.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
spring:
22
application:
33
name: xbin-store-cloud-service-item
4-
cloud:
5-
config:
6-
label: master
7-
profile: dev
8-
discovery:
9-
enabled: true
10-
service-id: config-server
11-
name: xbin-store-cloud-item
12-
rabbitmq:
13-
host: localhost
14-
port: 5672
15-
username: guest
16-
password: guest
174

185
security.basic.enabled: false
196

xbin-store-cloud-service-notify/src/main/java/cn/binux/XbinStoreServiceNotifyApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
@EnableHystrix
1313
@Configuration
14+
//@EnableApolloConfig
1415
@SpringBootApplication
1516
@EnableDiscoveryClient
1617
public class XbinStoreServiceNotifyApplication {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app.id=xbin-store-cloud-service-notify

xbin-store-cloud-service-notify/src/main/resources/bootstrap.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
spring:
22
application:
33
name: xbin-store-cloud-service-notify
4-
cloud:
5-
config:
6-
label: master
7-
profile: dev
8-
discovery:
9-
enabled: true
10-
service-id: config-server
11-
name: xbin-store-cloud-notify
12-
rabbitmq:
13-
host: localhost
14-
port: 5672
15-
username: guest
16-
password: guest
174

185
security.basic.enabled: false
196

xbin-store-cloud-service-order/src/main/java/cn/binux/XbinStoreServiceOrderApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
@EnableHystrix
1515
@Configuration
16+
//@EnableApolloConfig
1617
@SpringBootApplication
1718
@EnableDiscoveryClient
1819
@EnableTransactionManagement

0 commit comments

Comments
 (0)