Read about spring cloud config server maven, The latest news, videos, and discussion topics about spring cloud config server maven from alibabacloud.com
Start the server:$cdspring-cloud-config-server$../mvnwspring-boot:runthe server is a spring boot application, so you can run it from the IDE instead of liking it (the main class is ConfigServerApplication ). then try a client:$cu
, branch name, or label). If the Git branch or tag name contains a slash ("/"), you should specify the label in the HTTP URL with a special string "(_)" to avoid blurring with other URL paths. For example, if the label is foo/bar , replacing the slash will cause the label to look like foo(_)bar . If you use a command-line client like curl (for example, using quotation marks to relay it out of the shell), be careful with the square brackets in the URL.Placeholders in the Git URIThe
The main function of Spring Cloud Config is configserverapplication, which is defined as follows:@Configuration @enableautoconfiguration@enableconfigserver Public class configserverapplication { publicstaticvoid main (string[] args) { New springapplicationbuilder (configserverapplication. Class) . Properties ("Spring.config.name=confi
682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bdamysecretTip If you are testing with curl, use--data-urlencode (instead of-D) or set explicit content-type:text/plain to ensure that the data is encoded correctly when there are special characters (' + ' especially tricky).Add the encrypted value to the {cipher} prefix, and then place it in a Yaml or property file before committing and pushing it to a remote potentially unsafe store.The/encrypt and/decrypt endpoints also accept path
682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bdamysecretIf you are testing with curl, use--data-urlencode (instead of-D) or set explicit content-type:text/plain to ensure that the data is encoded correctly when there are special characters (' + ' especially tricky).Add the encrypted value to the {cipher} prefix, and then place it in a Yaml or property file before committing and pushing it to a remote potentially unsafe store.The/encrypt and/decrypt endpoints also accept paths in
682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bdamysecretIf you are testing with curl, use--data-urlencode (instead of-D) or set explicit content-type:text/plain to ensure that the data is encoded correctly when there are special characters (' + ' especially tricky).Add the encrypted value to the {cipher} prefix, and then place it in a Yaml or property file before committing and pushing it to a remote potentially unsafe store.The/encrypt and/decrypt endpoints also accept paths in
/decrypt -d 682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bdamysecretTip If you are testing with curl, use--data-urlencode (instead of-D) or set explicit content-type:text/plain to ensure that the data is encoded correctly when there are special characters (' + ' especially tricky).Add the encrypted value to the {cipher} prefix, and then place it in a Yaml or property file before committing and pushing it to a remote potentially unsafe store.The/encrypt and/decrypt endpoints also
:3.2.2.releaseFor example, the following:When using spring. The existence of a transaction is missing, and the transaction is in spring-orm , and will be spring-orm dependent on the projectIn the same way, the spring-orm jar package is then actively dependent on project.The following is the full Pom.xml file informatio
Configuration Center--spring Cloud ConfigThrough this study, we should grasp:
Config Server reads the configuration text
Config Server reads the configuration from a remote Git repository
Build Recco with
1. Create the Springcloud project, and introduce the corresponding spring-config-server corresponding jar 2. Create a Spring Boot startup class:Add the following two annotations@EnableConfigServer@SpringBootApplicationPackage Cn.lonecloud.config.server;import Org.springframework.boot.springapplication;import Org
.releaseAs follows:When using spring, the existence of a transaction is missing and the transaction is in spring-orm , and will be spring-orm dependent on the projectSimilarly, the spring-orm jar package will be automatically dependent on the project.Here are all the Pom.xml file information for
682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bdamysecretIf you are testing with curl, use --data-urlencode (not -d ) or set explicit to Content-Type: text/plain ensure that the data is encoded correctly when there are special characters (' + ' especially tricky).Add the encrypted value to the {cipher} prefix, and then put it in the Yaml or properties file, and then commit and push it to a remote potentially unsafe store./encryptAnd /decrypt endpoints also accept /*/{name}/{profi
682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bdamysecretIf you are testing with curl, use--data-urlencode (instead of-D) or set explicit content-type:text/plain to ensure that the data is encoded correctly when there are special characters (' + ' especially tricky).Add the encrypted value to the {cipher} prefix, and then place it in a Yaml or property file before committing and pushing it to a remote potentially unsafe store.The/encrypt and/decrypt endpoints also accept paths in
tag (commit ID, branch name, or label). If the Git branch or tag name contains a slash ("/"), you should use a special string "(Specify the label in the HTTP URL to avoid blurring with other URL paths. For example, if the label is Foo/bar, replacing the slash will cause the label to look like Foo () bar. If you use a command-line client like curl (for example, using quotation marks to relay it out of the shell), be careful with the square brackets in the URL.Placeholders in the Git URIThe
:8888/decrypt-D 682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bdamysecretTip If you are testing with curl, use --data-urlencode (not -d ) or set explicit to Content-Type: text/plain make sure that the data is encoded correctly when there are special characters (' + ' especially tricky).Add the encrypted value to the {cipher} prefix, and then put it in the Yaml or properties file, and then commit and push it to a remote potentially unsafe store./encryptAnd /decrypt endpoints also a
Brief introductionIn a real-world project environment, we do not store confidential text such as passwords in plaintext in the configuration file in case of theft. Spring Cloud Config provides an encryption method for encrypting plaintext text encrypted into ciphertext stored in a configuration file. Spring
Brief introductionIn a real-world project environment, we do not store confidential text such as passwords in plaintext in the configuration file in case of theft. Spring Cloud Config provides an encryption method for encrypting plaintext text encrypted into ciphertext stored in a configuration file. Spring
configuration:Bootstrap.ymlspring: application: name: foo profiles: active: dev,mysql(typically with spring boot applications, these properties can also be set to environment variables or command-line arguments).If the repository is file-based, the server creates environment from APPLICATION.YML (shared among all clients), FOO.YML (Foo.yml precedence)). If there are files in the Yaml file that poin
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.