Spring Cloud Consul-git2consul and configuration

Source: Internet
Author: User

Git2consul is a consul community project that loads files from a git repository into individual keys to consul. By default, the name of the key is the name of the file. Yaml and properties files support the. yml and. Properties file extensions, respectively. Set the Spring.cloud.consul.config.format property to files. For example:

Bootstrap.yml

spring:  cloud:    consul:      config:        format: FILES

Given the following key in the/config, the development configuration file and application name is foo:

gitignoreapplication.ymlbar.propertiesfoo-development.propertiesfoo-production.ymlfoo.propertiesmaster.ref

The following attribute sources will be created:

config/foo-development.propertiesconfig/foo.propertiesconfig/application.yml

The value of each key needs to be a properly formatted YAML or properties file.

Fast failure

In some cases, such as local development or some test scenarios, it may be convenient to not fail if the consul cannot be configured. Setting Spring.cloud.consul.config.failfast=false in Bootstrap.yml causes the configuration module to record a warning instead of throwing an exception. This will allow the application to continue to start normally.

Spring Cloud Consul-git2consul and configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.