#### To prepare we first need to download rabbitMq (default 4396 port)

Short for Message Queue, Message queues (MQ) are an application-to-application communication method. Applications communicate by reading and writing messages in and out of queues (data for the application) without the need for dedicated connections to link them. Messaging refers to programs communicating with each other by sending data in messages rather than by direct calls, which are typically used for techniques such as remote procedure calls. Queuing refers to applications communicating through queues. The use of queues removes the need for receiving and sending applications to execute simultaneously. Some of the more mature MQ products are IBM WEBSPHERE MQ and so on.

To install rabbitMq, you will need to install the Erlang environment (rabbitMq is written in this language because it supports concurrency well) and then install a plugin-management tool. Run rabbitmq-plugins enable rabbitmq_management and restart the RabbitMQ service to access 127.0.0.1:15672

All right, here we go. # # # # 1. Pom modification

        <dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-bus-amqp</artifactId>
		</dependency>
Copy the code

####2. Modify the configuration file

Spring: Cloud: config: uri: http://127.0.0.1:8080 profile: dev Label: Master Application: name: Spring-cloud-config-client rabbitmq: host: 127.0.0.1 port: 15672 username: guest password: guestCopy the code

####3. Start the server and the bus client service

  • Access to see if the service starts normally
  • Modify the application-dev file (suffixes the contents of the configuration file with bus) and push
  • Sending a curl RequestThe curl -x POST at http://127.0.0.1:8081/bus/refresh

    #### students see here, and manual refresh, and did not do automatic refresh ah. Don’t worry, go to your Git repository setting, find webhooks,

    Note: SpringCloud Bus can also be configured for each Config Server and Config Client. (Add dependency + modify configuration), so that sending POST requests to the server or client can achieve the purpose. The personal suggestion is sent to the server. Then the server pulls the configuration file and sends it to the client in a unified manner.