Spring Cloud uses RABBITMQ to configure the message bus

Source: Internet
Author: User
Tags rabbitmq
RABBITMQ

RABBITMQ window installation and use install Erlang installation RABBITMQ RABBITMQ Server installation will automatically register as a service note setting the environment variable rabbitmq_base to a path that does not contain Chinese

Rabbit Management

Can be managed by accessing the configuration file, or through the web. Manage through the Web:

Executive: Rabbitmq-plugins Enable Rabbitmq_management

Restart the service, open the browser http://localhost:15672, use the user name guest password guest login, you can see the management interface.

View users: Rabbitmqctl.bat list_users
Create User: Rabbitmqctl.bat add_user username password

Spring Cloud integrated RABBITMQ and Spring cloud bus

To configure the bus to add dependencies:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId> Spring-cloud-starter-bus-amqp</artifactid>
</dependency>

Add RIBBONMQ configuration to the configuration file:

Spring:
 Cloud: Bus
  :
   trace:
    enabled:true
 rabbitmq:
   host:10.11.85.21
   port:5672
   username:root
   password:123456

Start Configuration bus: Discover console output

Mapped ' {[/bus/refresh],methods=[post]} '

Modify configuration, send a POST request to Http://localhost:8888/bus/refresh, the service configuration on the bus will receive the message and update

To view the services on the RABBITMQ:

Access: Http://localhost:15672/#/connections
can view the number of links and corresponding IP ports on the current bus

Learning materials: Spring Cloud Micro service password: ITD9

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.