Skip to content

Commit

Permalink
optimize applicationDefaultJvmArgs for rest-api
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang committed Apr 28, 2021
1 parent ac5acc5 commit 6f021ff
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
18 changes: 17 additions & 1 deletion rest-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,27 @@ plugins {
application
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

application {
applicationDefaultJvmArgs = listOf("-Dspring.cloud.bootstrap.enabled=true")
mainClass.set("me.ahoo.govern.rest.RestApiServer")

applicationDefaultJvmArgs = listOf(
"-Xms512M",
"-Xmx512M",
"-server",
"-XX:+UseG1GC",
"-Xlog:gc*:file=logs/rest-api-gc.log:time,tags:filecount=10,filesize=100M",
"-Dspring.cloud.bootstrap.enabled=true",
"-Dspring.cloud.bootstrap.location=config/bootstrap.yml"
)
}


dependencies {
implementation(platform(project(":dependencies")))
implementation("io.springfox:springfox-boot-starter")
Expand Down
6 changes: 6 additions & 0 deletions rest-api/src/dist/config/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring:
cloud:
govern:
discovery:
registry:
weight: 8
15 changes: 15 additions & 0 deletions rest-api/src/dist/config/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
spring:
application:
name: govern-rest-api
cloud:
govern:
namespace: dev
config:
config-id: ${spring.application.name}.yml
redis:
mode: standalone
url: redis://localhost:6379
logging:
file:
name: logs/${spring.application.name}.log

4 changes: 4 additions & 0 deletions rest-api/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ spring:
redis:
mode: standalone
url: redis://localhost:6379
logging:
file:
name: logs/${spring.application.name}.log

0 comments on commit 6f021ff

Please sign in to comment.