RabbitMQ (1), rabbitmq

Source: Internet
Author: User
Tags rabbitmq

RabbitMQ (1), rabbitmq

After reading the introduction of RabbitMQ, it is mainly a message queue, that is, a message queue, which constantly writes information to the message queue, while the other end can read the information. It is mainly used to process messages. Currently, it is installed with Linux version RabbitMQ:

1: Install erlang

Apt-get install erlang-nox

2. download and install the RabbitMQ installation package

I downloaded the latest installation package installed rabbitmq-server_3.3.4-1_all.deb directly on its official website

3: Start

/Etc/init. d/rabbitmq-server start

4. Create a vhost

Rabbitmqctl add_vhost/pyhtest

I didn't know why I couldn't create it for the first time. I tried it again.

5. Create a user for the vhost.

Rabbitmqctl add_user pyh pyh1234

User name pyh password pyh1234

6. Create Permissions

Rabbitmqctl set_permissions-p/pyhtest pyh ". *"

* Indicates all permissions.

Later I wrote a send and receive statement. Now I haven't completed the sending and consumption process ......

The official website provides detailed examples, such as Hello World! :

Http://www.rabbitmq.com/tutorials/tutorial-one-python.html


How to configure multiple RabbitMQ instances on one machine

There are three configuration files for Rabbitmq, which are located at/etc/rabbitmq/. The three files are: (1) enabled_plugins. Set the list of allowed plug-ins, the configuration file is in the List format of erlang, such as [rabbitmq_management, rabbitmq_visualiser]. (2) rabbitmq. conf, set the operation parameters of rabbitmq. Each parameter in this configuration file is a tuple of erlang. The structure is {Key, Value}, Key is of the atom type, and Value is a term. The key parameters are: tcp_listerners sets the listening port of rabbimq. The default value is [5672]. Disk_free_limit: low watermark of a disk. If the disk capacity is lower than the specified value, the system stops receiving data. The default value is {mem_relative, 1.0}, which is associated with the memory and can be customized. vm_memory_high_watermark: Set the low-level memory line. If it is lower than this level line, the traffic control mechanism is enabled. The default value is 0.4, that is, 40% of the total memory. Hipe_compile uses High Performance Erlang compiler to compile some rabbimq code to improve Performance. This parameter is experimental. If erlang vm segfaults appears, disable it.

What scenarios does rabbitmq apply?

Rabbitmq
Edit

MQ is called Message Queue. MQ is a communication method for applications. Applications write and retrieve data (messages) for applications in the inbound and outbound queues to communicate with each other without dedicated connections. Message transmission refers to the communication between programs by sending data in messages, rather than by directly calling each other. Direct calls are usually used for such remote process calls. Queuing means that applications communicate through queues. The use of the queue removes the need to receive and send applications simultaneously. Among them, more mature MQ products include ibm websphere mq.
Use Cases
In the project, some operations that do not require immediate return and time-consuming are extracted for asynchronous processing. This asynchronous processing method greatly saves the server's request response time, this improves the system throughput.
 

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.