RabbitMQ is really a good thing. Of course, it also supports C-language client development. There are few examples and documents, so you can only view example in the project to understand them, and simply sort them out to avoid detours. The main reason is that the corresponding version is not as good as Maven. Only the class libraries and examples can be well implemented. Next, let's take a look at what we
ConnectionFactory () {
HostName = "localhost"}; using (var connection = factory. CreateConnection ()) using (var channel = connection. Createmodel ()) {channel.
Exchangedeclare (Exchange: "Direct_logs", type: "direct"); var queuename = Channel. Queuedeclare ().
QueueName; if (args.
Length
Create your project as usual (see tutorial [1]).
If you only want to warning error save and (not include info ) the log messages to a
all logs from the device "Kern":CD receivelogstopicdotnet Run "Kern. *”Or if you only want to hear information about the "critical" log:ReceiveLogsTopic.exe "*. Critical"You can create multiple bindings:CD receivelogstopicdotnet Run "Kern. * "*.critical"and issue the log using the "Routing key" "Kern.critical" type:CD emitlogtopicdotnet Run "kern.critical" "A critial Kernel Error"It's interesting to write these programs. Note that the code does not make any assumptions about the "routing key" o
RABBITMQ is what and how to install will not repeat, Baidu a bit to know, but in the configuration to pay more attention.
Not much to say, first directly to a simple example code
Send side:
ConnectionFactory factory = new ConnectionFactory {HostName = "HostName" , UserName = "root", Password = "root001", VirtualHost = "Hostserver"}; using (iconnection conn = factory. CreateConnection ()) {using (IModel IM = conn. Createmodel
middleware is mainly used for decoupling between components, the sender of the message does not need to know the existence of the message consumer, and vice versa. The main features of AMQP are message-oriented, queue, routing (including point-to-point and publish/subscribe), reliability, and security. RABBITMQ is an open-source AMQP implementation that is written in Erlang and supported by a variety of clients such as Python, Ruby,. NET, Java, JMS,
supports most of the development languages you can think of, such as Java, Ruby, Python,. net, C/C ++, and Erlang. Clients in various languages can be downloaded from its official website. 2. Features of rabbitmq
Compared with other MQ products, rabbitmq has obvious advantages.
You can find some comparisons in the
Basic concepts of RabbitMQ and rabbitmq
Go to: http://blog.csdn.net/whycold/article/details/41119807About RabbitMQ
AMQP (Advanced Message Queuing Protocol) is an open standard for application layer protocols and is designed for Message-oriented middleware. Message-oriented middleware is mainly used for decoupling between components. message senders do not need to
RabbitMQ Article 1: setup and configuration of rabbitMQ and rabbitmq Article 1
Install rabbitMQ in WindowsStep 1: Install software
If rabbitMQ is installed, first install OTP software based on the erlang language, and then download the r
try to receive messages from the queue. Queue will be drawn like the following figure:
Consuming is similar to receiving. Consumer is a program that is often waiting to receive messages. We use "C" to plot it:
Note that producer, consumer, and brokder do not need to reside on the same machine; in fact, they are not on the same machine in most applications.
Hello World!
(Use pika 0.9.8 Python client)
Our "Hello world" won't be too complicated-let's
1 RABBITMQ Introduction and InstallationRABBITMQ is an open-source AMQP implementation that is written in Erlang and supported by a variety of clients such as Python, Ruby,. NET, Java, JMS, C, PHP, ActionScript, XMPP, stomp, etc., and support Ajax. It is used to store and forward messages in distributed system, which is very good in ease of use, extensibility, high availability and so on.AMQP, Advanced mess
Installing RABBITMQ under 1.Windows requires the following steps(1): Download Erlang because the RABBITMQ server code is written using Erlang in the Concurrency language: http://www.erlang.org/downloads, Double-click the. exe file to install it, create an environment variable named Erlang_home after installation, its value points to the installation directory for ERLANG, add%erlang_home%\bin to path, and fi
[RabbitMQ] 6. Confirm the message of the rabbitmq producer and the rabbitmq producer.
Through the Publisher Confirms and Returns mechanism, the producer can determine whether the message is sent to exchange and queue. Through the consumer confirmation mechanism, Rabbitmq can decide whether to resend the message to the
RABBITMQ server:There are many batch files under Sbin to control RABBITMQ Server, and of course you can do it directly in the Setup Start menu:The simplest way is to make RABBITMQ run in the background as a Windows service, so we need to open cmd with Administrator privileges and then switch to the Sbin directory and execute these three commands:Rabbitmq-service
RABBITMQ server:There are many batch files under Sbin to control RABBITMQ Server, and of course you can do it directly in the Setup Start menu:The simplest way is to make RABBITMQ run in the background as a Windows service, so we need to open cmd with Administrator privileges and then switch to the Sbin directory and execute these three commands:Rabbitmq-service
, enter the plugins directory, copy the ez File above to the plugins directory, and then run the command to enable this plug-in.
In centos, the default path is/usr/lib/rabbitmq/lib/rabbitmq_server-3.3.4/plugins (the version number may change)
In windows, the default path is C: \ Program Files \ RabbitMQ Server \ rabbitmq_server-3.3.4 \ plugins (the version may ch
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.