From 991f6bfbbdf2cf383421c00b35c0c26e1de5e377 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Thu, 6 Jan 2022 18:49:50 +0100 Subject: [PATCH] Spring Cloud Consul: improve bootstrap properties --- .../consul/src/bootstrap.properties.mustache | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/resources/generator/server/springboot/springcloud/consul/src/bootstrap.properties.mustache b/src/main/resources/generator/server/springboot/springcloud/consul/src/bootstrap.properties.mustache index c79986116b1..4cf8c596527 100644 --- a/src/main/resources/generator/server/springboot/springcloud/consul/src/bootstrap.properties.mustache +++ b/src/main/resources/generator/server/springboot/springcloud/consul/src/bootstrap.properties.mustache @@ -3,10 +3,22 @@ #==================================================================== spring.application.name={{baseName}} -spring.cloud.consul.discovery.health-check-path=/management/health -spring.cloud.consul.discovery.tags[0]=version=@project.version@ -spring.cloud.consul.discovery.tags[1]=context-path=${server.servlet.context-path:} + spring.cloud.consul.host=localhost spring.cloud.consul.port=8500 + spring.cloud.consul.config.format=yaml spring.cloud.consul.config.profile-separator=- +spring.cloud.consul.config.watch.enabled=false + +spring.cloud.consul.discovery.health-check-path=/management/health +spring.cloud.consul.discovery.tags[0]=version=@project.version@ +spring.cloud.consul.discovery.tags[1]=context-path=${server.servlet.context-path:} +spring.cloud.consul.discovery.tags[2]=profile=${spring.profiles.active:} +spring.cloud.consul.discovery.tags[3]=git-version=${git.commit.id.describe:} +spring.cloud.consul.discovery.tags[4]=git-commit=${git.commit.id.abbrev:} +spring.cloud.consul.discovery.tags[5]=git-branch=${git.branch:} + +spring.cloud.consul.discovery.instance-id={{baseName}}:${spring.application.instance-id:${random.value}} +spring.cloud.consul.discovery.service-name={{baseName}} +spring.cloud.consul.discovery.prefer-ip-address=true