Spring Cloud Config automatically refreshes all node schema retrofits

Source: Internet
Author: User
Tags rabbitmq

Detailed reference: "Sprin Cloud and Docker Micro-service Architecture combat" p162-9.9.4 Festival

The changes to be made are:

1. Add SPRING-CLOUD-STARTER-BUS-AMQP package to Spring Cloud Config Server service side

<?xml version= "1.0" encoding= "UTF-8"? ><project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "http ://www.w3.org/2001/XMLSchema-instance "xsi:schemalocation=" http://maven.apache.org/POM/4.0.0/http Maven.apache.org/xsd/maven-4.0.0.xsd "><modelVersion>4.0.0</modelVersion><groupId> Com.thunisoft</groupid><artifactid>thunisoft-microservice-config</artifactid><version> 0.0.1-snapshot</version><packaging>jar</packaging><name>thunisoft-microservice-config </name><description>demo Project for Spring boot</description><parent><groupid> org.springframework.boot</groupid><artifactid>spring-boot-starter-parent</artifactid>< Version>1.5.10.release</version><relativepath/> <!--lookup parent from repository--></ parent><properties><project.build.sourceencoding>utf-8</project.build.sourceencoding>< Project.reporting.outputEncoding>utf-8</project.reporting.outputencoding><java.version>1.8</java.version>< spring-cloud.version>edgware.sr2</spring-cloud.version></properties><dependencies>< Dependency><groupid>org.springframework.cloud</groupid><artifactid> Spring-cloud-config-server</artifactid></dependency><dependency><groupid> Org.springframework.cloud</groupid><artifactid>spring-cloud-starter-bus-amqp</artifactid> </dependency><dependency><groupId>org.springframework.boot</groupId><artifactId> Spring-boot-starter-test</artifactid><scope>test</scope></dependency></dependencies ><dependencymanagement><dependencies><dependency><groupid>org.springframework.cloud </groupid><artifactid>spring-cloud-dependencies</artifactid><version>${ spring-cloud.version}</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencymanagement><build>< Plugins><plugin><groupid>org.springframework.boot</groupid><artifactid> Spring-boot-maven-plugin</artifactid></plugin></plugins></build></project>

  

2. Add Configuration

  RABBITMQ:    host:localhost    port:5672    username:guest    password:guest
Spring:  application:    name:thunisoft-microservice-configs  Cloud:    config:      server:        git:          uri:https://gitee.com/ultrastrong/spring-cloud-config          clone-on-start:true # boot time on clone config repository        Default-application-name:thunisoft-microservice-foo  rabbitmq:    host:localhost    port:5672    Username:guest    password:guestserver:  port:8979# default off permission validation management:  Security:    Enabled:false

Do not forget to turn off server-side security authentication, otherwise you will not be able to access the endpoint.

3, when using the/bus/refresh endpoint refresh configuration, as long as the server side on the line, so that all the endpoints will be able to receive the update request.

Http://localhost:8979/bus/refresh

  

Spring Cloud Config automatically refreshes all node schema retrofits

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.