Skip to content

Commit

Permalink
upgrade spring-boot to 2.4.2 and spring-cloud to 2020.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodyiam committed Jan 30, 2021
1 parent f817182 commit fbec10d
Show file tree
Hide file tree
Showing 29 changed files with 190 additions and 109 deletions.
5 changes: 5 additions & 0 deletions apollo-adminservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-apache-client4</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
spring.application.name= apollo-adminservice
ctrip.appid= 100003172
server.port= 8090
logging.file= /opt/logs/100003172/apollo-adminservice.log
logging.file.name= /opt/logs/100003172/apollo-adminservice.log
spring.jmx.default-domain = apollo-adminservice
25 changes: 23 additions & 2 deletions apollo-adminservice/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ ctrip:

server:
port: 8090

logging:
file: /opt/logs/100003172/apollo-adminservice.log
file:
name: /opt/logs/100003172/apollo-adminservice.log

eureka:
instance:
hostname: ${hostname:localhost}
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
client:
serviceUrl:
# This setting will be overridden by eureka.service.url setting from ApolloConfigDB.ServerConfig or System Property
# see com.ctrip.framework.apollo.biz.eureka.ApolloEurekaClientConfig
defaultZone: http://${eureka.instance.hostname}:8080/eureka/
healthcheck:
enabled: true
eurekaServiceUrlPollIntervalSeconds: 60

management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
19 changes: 0 additions & 19 deletions apollo-adminservice/src/main/resources/bootstrap.yml

This file was deleted.

2 changes: 1 addition & 1 deletion apollo-adminservice/src/main/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ then
export SPRING_DATASOURCE_USERNAME=$DS_USERNAME
export SPRING_DATASOURCE_PASSWORD=$DS_PASSWORD
fi
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file.name=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
export APP_NAME=$SERVICE_NAME

PATH_TO_JAR=$SERVICE_NAME".jar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.Ph
spring.jpa.properties.hibernate.show_sql=false
spring.h2.console.enabled = true
spring.h2.console.settings.web-allow-others=true

spring.main.allow-bean-definition-overriding=true
20 changes: 19 additions & 1 deletion apollo-adminservice/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ server:
logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/${ctrip.appid}/apollo-adminservice.log
file:
name: /opt/logs/${ctrip.appid}/apollo-adminservice.log

ctrip:
appid: 100003172

eureka:
instance:
hostname: ${hostname:localhost}
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
client:
serviceUrl:
defaultZone: http://${eureka.instance.hostname}:8090/eureka/
healthcheck:
enabled: true

management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
16 changes: 0 additions & 16 deletions apollo-adminservice/src/test/resources/bootstrap.yml

This file was deleted.

28 changes: 27 additions & 1 deletion apollo-assembly/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,30 @@ spring:
active: ${apollo_profile}

logging:
file: /opt/logs/100003171/apollo-assembly.log
file:
name: /opt/logs/100003171/apollo-assembly.log

management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
ldap:
enabled: false

eureka:
instance:
hostname: ${hostname:localhost}
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
server:
peerEurekaNodesUpdateIntervalMs: 60000
enableSelfPreservation: false
client:
serviceUrl:
# This setting will be overridden by eureka.service.url setting from ApolloConfigDB.ServerConfig or System Property
# see com.ctrip.framework.apollo.biz.eureka.ApolloEurekaClientConfig
defaultZone: http://${eureka.instance.hostname}:8080/eureka/
healthcheck:
enabled: true
eurekaServiceUrlPollIntervalSeconds: 60
4 changes: 4 additions & 0 deletions apollo-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
Expand Down
8 changes: 4 additions & 4 deletions apollo-common/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spring.http.converters.preferred-json-mapper=gson
spring.mvc.converters.preferred-json-mapper=gson

# DataSource
spring.datasource.hikari.connectionInitSql=set names utf8mb4
Expand All @@ -14,10 +14,10 @@ server.tomcat.accept-count=5000
# Increase tomcat header size for longer GET query parameter, should be n * 1024
server.max-http-header-size=10240

# Spring Boot 2.0
# Spring Boot 2.x
management.endpoints.web.base-path=/
logging.file.max-size=50MB
logging.file.max-history=10
logging.logback.rollingpolicy.max-file-size=50MB
logging.logback.rollingpolicy.max-history=10

management.endpoints.web.exposure.include=info,health,metrics,prometheus

Expand Down
4 changes: 4 additions & 0 deletions apollo-configservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-apache-client4</artifactId>
</dependency>
<!-- end of eureka -->
<dependency>
<groupId>com.alibaba.nacos</groupId>
Expand Down
26 changes: 25 additions & 1 deletion apollo-configservice/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,28 @@ server:
port: 8080

logging:
file: /opt/logs/100003171/apollo-configservice.log
file:
name: /opt/logs/100003171/apollo-configservice.log

eureka:
instance:
hostname: ${hostname:localhost}
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
server:
peerEurekaNodesUpdateIntervalMs: 60000
enableSelfPreservation: false
client:
serviceUrl:
# This setting will be overridden by eureka.service.url setting from ApolloConfigDB.ServerConfig or System Property
# see com.ctrip.framework.apollo.biz.eureka.ApolloEurekaClientConfig
defaultZone: http://${eureka.instance.hostname}:8080/eureka/
healthcheck:
enabled: true
eurekaServiceUrlPollIntervalSeconds: 60

management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
22 changes: 0 additions & 22 deletions apollo-configservice/src/main/resources/bootstrap.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
spring.application.name= apollo-configservice
ctrip.appid= 100003171
server.port= 8080
logging.file= /opt/logs/100003171/apollo-configservice.log
logging.file.name= /opt/logs/100003171/apollo-configservice.log
spring.jmx.default-domain = apollo-configservice
2 changes: 1 addition & 1 deletion apollo-configservice/src/main/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ then
export SPRING_DATASOURCE_USERNAME=$DS_USERNAME
export SPRING_DATASOURCE_PASSWORD=$DS_PASSWORD
fi
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file.name=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
export APP_NAME=$SERVICE_NAME

PATH_TO_JAR=$SERVICE_NAME".jar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ spring.h2.console.enabled = true
spring.h2.console.settings.web-allow-others=true
spring.jpa.properties.hibernate.show_sql=false

spring.main.allow-bean-definition-overriding=true

# for ReleaseMessageScanner test
apollo.message-scan.interval=100
22 changes: 20 additions & 2 deletions apollo-configservice/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ server:
logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/${ctrip.appid}/apollo-configservice.log
file:
name: /opt/logs/${ctrip.appid}/apollo-configservice.log

ctrip:
appid: 100003171
appid: 100003171

eureka:
instance:
hostname: ${hostname:localhost}
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
client:
serviceUrl:
defaultZone: http://${eureka.instance.hostname}:8080/eureka/
healthcheck:
enabled: true

management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
16 changes: 0 additions & 16 deletions apollo-configservice/src/test/resources/bootstrap.yml

This file was deleted.

7 changes: 4 additions & 3 deletions apollo-portal/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ server:
use-relative-redirects: true

logging:
file: /opt/logs/100003173/apollo-portal.log
file:
name: /opt/logs/100003173/apollo-portal.log

management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP


ldap:
enabled: false # disable ldap health check by default
2 changes: 1 addition & 1 deletion apollo-portal/src/main/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ then
export SPRING_DATASOURCE_USERNAME=$DS_USERNAME
export SPRING_DATASOURCE_PASSWORD=$DS_PASSWORD
fi
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file.name=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
export APP_NAME=$SERVICE_NAME

PATH_TO_JAR=$SERVICE_NAME".jar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.yaml.snakeyaml.constructor.ConstructorException;
import org.yaml.snakeyaml.constructor.DuplicateKeyException;

@RunWith(MockitoJUnitRunner.class)
public class ItemControllerTest {
Expand Down Expand Up @@ -46,7 +47,7 @@ public void yamlSyntaxCheckOK() throws Exception {
itemController.doSyntaxCheck(assemble(ConfigFileFormat.YAML.getValue(), yaml));
}

@Test(expected = IllegalStateException.class)
@Test(expected = DuplicateKeyException.class)
public void yamlSyntaxCheckWithDuplicatedValue() throws Exception {
String yaml = loadYaml("case2.yaml");

Expand Down
1 change: 1 addition & 0 deletions apollo-portal/src/test/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.Ph
spring.jpa.properties.hibernate.show_sql=false
spring.h2.console.enabled = true
spring.h2.console.settings.web-allow-others=true
spring.main.allow-bean-definition-overriding=true
5 changes: 3 additions & 2 deletions apollo-portal/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ spring:
logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/100003173/apollo-portal.log

file:
name: /opt/logs/100003173/apollo-portal.log

apollo:
portal:
envs: local
Expand Down
Loading

0 comments on commit fbec10d

Please sign in to comment.