Preface: Here I will use Java to implement the RABBITMQ simply. Below we take the following question to step by step understanding and learning rabbitmq.1: What should we do if the consumer connection is interrupted?2: How to do load balancing3: How to effectively send the data to the relevant recipients? is how to filter4: How to ensure consumers receive complete and correct data5: How to get high priority
Exchanger (Exchange)The switch is like a router, we first send the message to the exchanger, and then the switch based on the BIND key (binding key) and the producer sends the message when the routing key Routingkey,Exchange types (fanout,direct,topic) deliver messages to the corresponding queue by Exchange type. (It is important to understand this concept, which is fully reflected in the code that follows).RABBITMQ basic knowledge to view Message Que
not by default and must be created by themselves if necessary.Rabbitmq-env.confThe location of this file is determined and immutable, located in:/etc/rabbitmq directory (this directory needs to be created by itself).The contents of the file include some of the environment variables of RABBITMQ, which are commonly used:#RABBITMQ_NODE_PORT =//Port number#HOSTNAME
/rabbitmq.config file (not added), add the following configuration on it.
4, add Users
Vim/etc/rabbitmq/rabbitmq.configAnd then add
[
{rabbit, [{tcp_listeners, [5672]}, {loopback_users, [' ASDF ']}]}
.Look, there's a dot on the top.
Now you have added a new authorized user, ASDF, to use this username remotely. Remember to use the command to add this command first:
cd/usr/lib/rabbitmq/bin/#用户名与密码
) Installation RABBITMQ1. Download:# wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.2/rabbitmq-server-generic-unix-3.4.2.tar.gz2. Decompression:# TAR-ZXF Rabbitmq-server-generic-unix-3.4.2.tar.gz3. Move this directory down to/usr/local and rename it to RABBITMQ:# MV RAB
enter 127.0.0.1:15672 access RABBITMQ in the browser, first into the RABBITMQ installation directory sbin, you can see the plugins configurationYou can use the command: Rabbitmq-plugins enable rabbitmq_management rabbitmqweb default account: Guest Password: Guest, we can add users, set roles, and set permissions. Add user admin and set password to 123456 you can
Cluster-node1127.0.0.1 Cluster-node2Save.2. Modify Rabbitmq-server.batAdd in rabbitmq-server* set rabbitmq_config_file= "C:\Program files\rabbitmq server\rabbitmq_server-3.6.2\etc\cluster-1" // Where the path is the path of the config file for the current nodeThis parameter is primarily used to configure the config file for
RABBITMQ to achieve Hello World is actually very simple. Only one server is required to send the message, and another client receives a message.The overall design process is as follows:650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/74/2D/wKiom1
RabbitMQ original translated 01 -- Introduction, rabbitmq translated 01 -- Introduction
All the articles in this series are from the original articles on the official website and belong to personal translators. If there are similar articles, you can archive them and try again.
RabitMQ is a message-oriented middleware that receives messages from the message producer and sends them to the Message consumer.
1: Environment SelectionThe system for Ubuntu 15.04, I installed in the virtual machine inside the2:rabbitmqTABBITMQ 3.5.4 Download url:http://www.rabbitmq.com/3: InstallationIn the Ubuntu environment, it is recommended that you download the Deb installer directly, install it directly in Ubuntu package management, and install other dependent packages4: StartIf the Deb package is installed directly, it is started directly by default, or it can be started by sudo
Install the latest version of RABBITMQ (3.3.1), and enable management plugin, using the default account guest login to the management console, but prompted the login failed.
After looking through the official release document, I learned that because the account guest has all the operation rights, and is the default account, for security reasons, guest users can only use localhost login, It is recommended that you modify the password of the guest user
-BOOT-STARTER-AMQP support
2. Configuration files
Configure the installation address, port, and account information for the RABBITMQ
SPRING.APPLICATION.NAME=SPIRNG-BOOT-RABBITMQ
spring.rabbitmq.host=192.168.0.86
spring.rabbitmq.port= 5672
spring.rabbitmq.username=admin
spring.rabbitmq.password=123456
3. Queue Configuration
@Configuration public
class Rabbitco
Install the deployment 1. Current environment and reference sources
Deployment environment: Windows Server R2 Enterprise
Official installation Deployment Documentation: http://www.rabbitmq.com/install-windows.html Official Document description
2. Installing ErlangFirst, download and run the Erlang Windows binaries. After the installation is successful, the Erlang program should be found in all programs.3. Installing RABBITMQOn the official page, download the corresponding insta
Learn to use. Looking for a half-day node. JS under the RABBITMQ Library, looks not to take the hand, until finally found the AMQP library, it looks good, according to the example, wrote the first RABBITMQ client.First, install the NODE-AMQP library using NPM install AMQP--save, although he recommends using a global installation, but don't do it!The following is the client code:[JavaScript]View Plaincopypri
A few of the previous tutorials explain how to use rabbitmq, which focuses on spring integrated RABBITMQ.First introduce the configuration file org.springframework.amqp, as follows One: Configure the Consumer and Generator public sectionPort= "${rabbit.port}" username= "${rabbit.username}" password= "${rabbit.password}" virtual-host= "${rabbit.virtualHost} "Channel-cache-size= "/> Two: Configuration Generatorimport resource= "amqp-share.xml"/>
A few of the previous tutorials explain how to use RABBITMQ, which focuses on spring integrated RABBITMQ.First introduce the configuration file Org.springframework.amqp, as follows One: Configure the consumer and Generator public sectionTwo: Configuration generatorIII: Producer Procedurespublic class Spittle implements Serializable { private Long ID; Private Spitter spitter; private String message; Private Date postedtime; Public
Cms.open.itPlatform.service.rq.impl.MQProducerImpl;
public class Rqtest {
final String Queue_key = "Test_queue_key";
@Test public
Void Send () {
ApplicationContext context = new Classpathxmlapplicationcontext ("classpath:/ Spring-config.xml ");
Imqproducer mqproducer = Context.getbean (mqproducerimpl.class);
map
After reading the RABBITMQ introductory tutorial one or two, I believe you have been able to build your own
asynchronous line thread operation is a time-consuming operation, a request to open 2 threads, and a standard configuration of the ECS server supporting the number of concurrent threads around 800, assuming that a thread in 10 seconds to complete, the single server can support up to 400 requests for concurrency, followed by queuing. This situation, it is necessary to consider increasing the server load, embarrassing increase in costs.How Message Queuing RAB
accesses the application, we want to record the user's operation record and the system Exception log, the general practice is to save the system generated log to the server disk, the server to open the scheduled task, timed to transfer the log information of the disk into MQ (producer), The messages in MQ are also timed out and co-existing in the appropriate database, such as Elasticsearch or hive.Five. How do I install RABBITMQ?The above case descri
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.