Today we are going to learn the last exchanger type: topic. Direct is placed in a queue in exchange bindings, and fanout is placed in all the queues in exchange bindings. Is there any part of the queue that is placed in the exchange bindings, or if multiple routing keys can be routed to a queue, then the topic type of exchange will be used.650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7E/EA/wKiom1cMrYvCk0vYAAETr3j13dU392.png "title=" 1.PNG " alt= "Wkiom1cmryvck0vyaaetr3j13du392.png"
1, installation
Installing RABBITMQ under Mac is very simple, and the general default RABBITMQ server-dependent Erlang has been installed, with the following two commands to complete the RABBITMQ installation (provided homebrew has been installed):
Brew Update
Brew install RABBITMQ
Be patient, add/usr/local/sbin to
Install the Rabbit MQ Guide on Windows, preferably the Rabbit MQ Windows installation guides, which also includes access Rabbit using the. NET rabbitmq.client Nuget Package Example code for MQ.
Installing rabbit MQ
Rabbit MQ is built on the powerful Erlang OTP platform, so installing Rabbit MQ is premised on the installation of Erlang. Download the installation via the following two connections 3.2.3 version: Download and install ERALNG OTP for Windows (VR16B03) Otp_win64_17.0.exe (Erlang Enviro
Recently a project used to RABBITMQ, in order to catch the test progress, had to build their own environment. The server is CentOS6.5, the installation process is basically according to the official website document flow, see RABBITMQ installs. But there are a few steps that are slightly different.The first is to install ErlangYum Install ErlangThis process is relatively long, my server installed a total of
Ch:task.toCharArray ()) {
if (ch = = '. ')
Thread.Sleep (1000);
}
}
}
Start several consumer work processes, use the producer to send messages, can observe the consumption situation.
To understand the routing mechanism of RABBITMQ, Exchange is a key. Exchange can be called a switch, and it seems to be called a router, which is used to select a route anyway. The core
RabbitMQ is an open-source enterprise-level message system based on AMQP (AdvancedMessageQueuingProtocol) and has high reliability. It is currently used by many websites, including reddit and Poppen.de. 1. Install RabbitMQsudoapt-getinstallrabbitmq-serversudo/etc/init. d/rabbitmq-serverstart in Ubuntu
RabbitMQ is an open-source enterprise-level Message system bas
Rabbitmq_managementStart Rabbitmq-service.bat as an administrator after installation is completeRabbitmq-service.bat stopRabbitmq-service.bat InstallRabbitmq-service.bat start4: Browser access localhost:55672 default account: Guest Password: Guest5. The rabbit also comes with a monitoring function.CMD into the sbin directory, type rabbitmq-plugins enable rabbitmq_management enabling monitoring management,
Centos source code Compilation installation ErlangWhich libraries does Erlang depend on?A fully working GCC compiler environmentncurses Development LibrariesOpenSSL Development libraries (must be installed if using MySQL)After installing these libraries, you must re-execute the Configure command, after which you will be prompted to configure which dependent libraries are not installed, and you can discard the installation of some libraries according to your needs, and the above can be done using
A complete example of C # RabbitMQ operations,
1. Download RabbitMQ
Http://www.rabbitmq.com/install-windows.html
Ii. Download OTP
Http://www.erlang.org/downloads
3. Install OTP and RabbitMQ
4. Configure RabbitMQ
Find the bat directory
Execute related commands
1. Add User PasswordRabbitmqctl add_user wenli
2. Set
();
4. Create a channel through connection channels channel = Connection.createchannel (); 5. Specify queue Channel.queuedeclare via Channel (Queue_name, False, False, FAlse, NULL);
Unlike sending messages,//6. Create a consumer queue consumer and specify channel Queueingconsumer consumer = new Queueingconsumer (channel);
7. Specify consumer Channel.basicconsume for channel (Queue_name, True, consumer); while (true) {//Gets the message in the queue from consumer, Nextde
bound his queue formation messages, and each queue gets the message corresponding to the binding
Six. Consumer clustersDifferentiated from the publish subscription, consumer cluster mainly solve the problem of horizontal server expansion, if a queue backlog too much, how to let different consumers to bear. By default, RABBITMQ sends messages to each consumer (consumer) in order. On average, each consumer receives the same number of messages. T
On the official website download the version we need, the installation of RABBITMQ requires Erlang supportRabbitmq:http://www.rabbitmq.com/download.htmlErlang:http://www.erlang.org/download.htmlWe first install ErlangWindows version of Erlang installation is a fool-style, I installed the version is Otp_win64_r15b03-1.exeThen install the RABBITMQ, the same is the fool, I installed the version is
View Node-level data such as memory use and clustering
View truly global statistics for all virtual hosts
Administrator
Everything "policymaker" and "monitoring" can plus:
Create and delete virtual hosts
View, create and delete users
View, create and delete permissions
Close other users ' s connections
There are other commands, please check it when needed.Five, the installation process encountered problem
CentOS71. Installation systemInfrastructure server: Java platform, Linux Remote management, development tools2. Open the network connection:(1) cd/etc/sysconfig/network-scripts/#进入网络配置文件目录(2) vi ifcfg-eno16777736 #编辑配置文件, modify the following content(3) Change onboot from No to Yes(4) Exit Edit(5) Service Network restart3. Turn off SELinux(1) Setenforce 0(2) Vi/etc/sysconfig/selinuxChange the line inside toSelinux=disabled4. Installing ErlangSu-c ' RPM-UVH http://download.fedoraproject.org/pub/e
RabbitMQ PHP Usage
RABBITMQ is an open source, highly reliable enterprise-class messaging system based on the AMQP (Advanced message Queuing Protocol) standard, with many websites currently in use, including reddit,poppen.de.
1. Installing Rabbitmqsudo apt-get Install Rabbitmq-serversudo/etc/init.d/rabbitmq-server
Use Python, RabbitMQ, and Nameko to implement microservicesGuide"Microservices are a new wave"-nowadays, splitting projects into multiple independent and scalable services is the best choice to ensure code evolution. In the world of Python, there is a framework called "Nameko", which makes the implementation of microservices simple and powerful.
In recent years, "microservice architecture" has sprung up. It is used to describe a specific software appl
declare queues in order to prevent producers from declaring the queue, resulting in an error running. DEF callback (ch, method, properties, body):"""callback function to handle messages taken out of RABBITMQ:p Aram Ch: Channel:p Aram Method: Methods:p Aram Properties: Property:p Aram Body: Content:return: Received information"""Print"[x] Received%r"%body) # Print (ch,method,properties,body)"""ObjectAt0x0000000002f1db70> 'CONSUMER_TAG=CTAG1.3C1D688587C447E5AC3A72EA99E98CAC','delivery_tag=1','exc
applications it is true.
2. "Hello World"
In this part of the use of the guide, we have to write two programs in Java, one is the producer, he sent a message, the other is the consumer, it receives the message, and print the message. Instead of ignoring the details of some Java APIs, we'll focus on what we're going to do, which is sending a "Hello world" message.
In the figure below, "P" represents the producer, and "C" stands for the consumer. In the middle is a Queue, a message buffer.
Java
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.