A preliminary understanding RabbitMQ and installation

Foreword

  After a complete process involved in the project consists of three main roles, and when one of the relevant aspects of operational roles, roles of the other two pages, and the process also requires a corresponding and timely change and jump.
  The first is to send an asynchronous request to use Ajax, according to the change process state database values, and timely change pages in different roles. As a page to each user needs to set the timer task, to continuously access the server to obtain process state values and do the corresponding logic determines whether the user needs to change the page, thereby causing the pressure multiplied with the database server, may also cause server and database downtime.

First, what RabbitMQ that?

  MQ called the Message Queue, the message queue (MQ) is an application communication method according to the application. It is simply, a way of transmitting the data (messages) between the two programs.
  RabbitMQ is a lightweight, open-source messaging middleware, high concurrency, stable, durable, and other characteristics

Two, RabbitMQ usage scenarios

    1, to process messages asynchronously;

    2, the decoupling applications: for distributed in;

    3, flow rate cut front: for high concurrency, spike;

    4, log processing: Large data;

    ……

Three, RabbitMQ few basic concepts

    1, RabbitMQ structure of FIG.

    2, several concept notes

  • Producer: message producer, messaging program;
  • Exchange: Message switch that specifies what the message according to the rules, which are routed to a queue.
  • Queue: vector message queue, each message will be put into one or more queues.
  • Binding: binding, its role is to bind the Queue Exchange and in accordance with the routing rules.
  • Routing Key: routing keys - have this message and binding property, the switch sends a message will look for a message queues that are bound in the routing key that matches the push message.
  • Vhost: virtual host, a plurality Vhost RabbitMQ can set, as the separation of different user rights.
  • Channel: news channels, in each client's connection can create multiple Channel, Channel each task represents a session for creating Exchange, Queue and so on.
  • Consumer: Consumer news, is that the program accepts messages.

Fourth, download and install

    1, download the installation package RabbitMQ

    1.1, enter the RabbitMQ official website to download ;

Download windows version entrance

    1.2, and Erlang RabbitMQ download installation package;

    Note: Running RabbitMQ services need to support Erlang environment, as required java jdk environment supports general.

Download RabbitMQ Erlang language and environment support

    NOTE: To view your downloaded RabbitMQ version matching relation required version of Erlang environment and to ensure that the relationship between the two versions meet the requirements.

And RabbitMQ version correspondence between Erlang

    1.3, find your downloaded RabbitMQ installation package with Erlang, click otp_win64_xxx.exe installed Erlang environment;

    1.4, after the installation environment, click rabbitmq-server-xxx.exe RabbitMQ installation services;

    1.5, enter rabbitmq-server installation directory under sbin, enter the command:

rabbitmq-plugins enable rabbitmq_management rabbitmq_web_stomp rabbitmq_stomp

Open the installation directory

    1.6 restart RabbitMQ service, browser and enter localhost: 15672, login. The default account and password: guest / guest;

web management page

    Note: If this management page, proceed as follows did not see coming:

    After> 1.4 and repeat - open the C drive -> User (User) -> your user name -> AppData -> Roaming -> RabbitMQ -> db -> delete all the files in that folder A step of

 

RabbitMQ download the installation package and its environment -3.7.10 version

 


Published 47 original articles · won praise 16 · views 70000 +

Guess you like

Origin blog.csdn.net/zorro_jin/article/details/85119717