From 2bdf37378b12ff882f7644e8786763d2bc25848e Mon Sep 17 00:00:00 2001 From: Yansheng Wei Date: Wed, 25 Nov 2020 14:00:57 -0600 Subject: [PATCH 1/2] - Update SpringBoot version - Enable Graceful shutdown, and use JDK 11 as default --- README.md | 2 +- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- manifest.yml | 12 +++++++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3c50f736f..f8888c3ed 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The application use Spring Java configuration and [bean profiles](http://docs.sp ## Building -This project requires Java 8 to compile. It will not compile with Java 9 or later. +This project compiles with Java 8 and Java 11. Other versions are not tested. To build a runnable Spring Boot jar file, run the following command: diff --git a/build.gradle b/build.gradle index bed91e1b2..bf59526c3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - springBootVersion = '2.2.4.RELEASE' + springBootVersion = '2.3.4.RELEASE' javaCfEnvVersion = '2.1.1.RELEASE' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2435be0a0..82055497c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip diff --git a/manifest.yml b/manifest.yml index e983909ee..6d8f491dc 100644 --- a/manifest.yml +++ b/manifest.yml @@ -3,8 +3,18 @@ applications: - name: spring-music memory: 1G random-route: true + buildpacks: + - java_buildpack_offline path: build/libs/spring-music-1.0.jar env: JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{enabled: false}' -# JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 11.+ } }' + JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 11.+ } }' + SPRING_APPLICATION_JSON: '{ "server.shutdown": "graceful", "spring.lifecycle.timeout-per-shutdown-phase": "10s" , "sever.max-keep-alive-requests": -1}' + + #A side car example + #sidecars: + #- name: connection-collector + # process_types: [ 'web' ] + # command: ./check-connections.sh + # memory: 32MB From 50b7b439b7cdf9b7885f967a2a7a4edbdb2f3305 Mon Sep 17 00:00:00 2001 From: Yansheng Wei Date: Wed, 25 Nov 2020 14:17:52 -0600 Subject: [PATCH 2/2] Add http health --- gradle/wrapper/gradle-wrapper.properties | 2 +- manifest.yml | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e8894b028..be52383ef 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip diff --git a/manifest.yml b/manifest.yml index 6d8f491dc..e12832e01 100644 --- a/manifest.yml +++ b/manifest.yml @@ -3,15 +3,22 @@ applications: - name: spring-music memory: 1G random-route: true - buildpacks: - - java_buildpack_offline + + #uncomment next 2 lines to disable buildpack autodetect + #buildpacks: + #- java_buildpack_offline + path: build/libs/spring-music-1.0.jar + health-check-type: http + health-check-http-endpoint: /actuator/health env: JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{enabled: false}' - JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 11.+ } }' +# JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 11.+ } }' + + #Enable graceful shutdown to avoid 502 errors SPRING_APPLICATION_JSON: '{ "server.shutdown": "graceful", "spring.lifecycle.timeout-per-shutdown-phase": "10s" , "sever.max-keep-alive-requests": -1}' - #A side car example + #A side car example, "command" can be anything that you ship with spring-music-1.0.jar #sidecars: #- name: connection-collector # process_types: [ 'web' ]