Skip to content

Instantly share code, notes, and snippets.

@alexcmd
Last active January 10, 2020 14:34
Show Gist options
  • Save alexcmd/a072ed5c303e657e230f78f1f6f2a02d to your computer and use it in GitHub Desktop.
Save alexcmd/a072ed5c303e657e230f78f1f6f2a02d to your computer and use it in GitHub Desktop.
Bootstrap config for Spring Boot Consul cloud Configuration and Service Discovery
server:
port: 0
management:
server:
port: 9155
endpoints:
web:
base-path: /
exposure:
include: '*'
app:
key1: test
spring:
application:
name: app
cloud:
consul:
host: localhost
port: 8500
config:
# Consul Key Path
# Default cfg /config/apps.yml
# App cfg /config/app/application.yml
enabled: true
format: files
name: /${spring.application.name}/application
defaultContext: 'apps'
prefix: /config
data-key: 'application'
discovery:
health-check-path: /health
instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
consul agent -data-dir=/tmp/consul -bootstrap=true -server=true -bind=127.0.0.1 -dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment