1 environment
- System environment: win10
- Editor: IDEA
- springcloud:H版
- rabbitmq
2 Introduction
- springcloud bus agent connected by a lightweight micro-messaging service is available each broadcast configuration file to change / monitoring or management services
- Installation rabbitmq article reference
3 Refresh All
1 Add rely bus
config-server和config-client pom都要添加
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
2 rabbitmq YML 配置
config-server和config-client bootstrap.yml都要添加如下配置
spring:
rabbitmq:
host: xxxx
port: 5672
username: guest
password: guest
3 config-server add-dependent monitoring
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
4 springsecurity profile
Config previous article retry closed springsecurity yml configuration content is now open
5 Start Project (config-server config-client eureka-server)
- Check whether access client refresh implementation
- Modify the file post -> http: // localhost: 8088 / actuator / bus-refresh
- Indeed visit again updated
6-by-refresh
1 packaged config-client
2 Start 2 client
java -jar config-client-0.0.1-SNAPSHOT.jar --server.port=8091
java -jar config-client-0.0.1-SNAPSHOT.jar --server.port=8090
3 git modified again on the test file is test321
4 unvisited ago
5 single client interface to refresh
- Now I want to refresh the 8090 port 8091 is not updated (a real scene is impossible refresh n other interfaces)
- access
http://localhost:8088/actuator/bus-refresh/client1:8090
- access
7 Summary
Dependent monitoring and configuration rabbitmq xxx bus-refresh rabbitmq
Refresh All (visit http: // localhost: 8088 / actuator / bus-refresh) and by-refresh (server does not change) the need for client-by-refresh yml be configured for example eureka {Port number} access monitoring post little difference http: // localhost: 8088 / actuatorApplication name: port number