. NET RabbitMQ practices [configuration]

Source: Internet
Author: User
Tags guid generator

This series is currently planned to write four articles, namely configuration, example, WCF release, and practice. Of course, Food addition is not ruled out.



RabbitMQ is a complete and usable enterprise Message System Based on AMQP protocol standards. He complies with the Mozilla Public License open-source protocol. An industrial-level MQ server implemented using Erlang.

RabbitMQ official site: http://www.rabbitmq.com/

AMQP(Advanced Message Queue Protocol) is an application layer protocol specification used for asynchronous message transmission. It serves as a line layer protocol rather than an API (such as JMS ), the AMQP client can send and accept messages without any source. The original purpose of AMQP is to provide a message protocol that can collaborate with each other in the financial sector, while the goal is to provide a common building tool for the general message queue architecture. Therefore, message-oriented middleware (MOM) systems, such as Publish/subscribe queues, are not implemented as basic elements. Instead, by sending simplified AMQ entities, users are given the ability to build such entities. These entities are also part of the specification, forming a level at the top of the online timeline Protocol: AMQP model. This model unifies the message mode, such as the publishing/subscription, queue, transaction, and stream data mentioned earlier, and adds additional features, such as easier scalability and content-based routing.

At present, this open-source project is very mature and applied in financial systems and other fields. It features high concurrency efficiency and high reliability, and provides the corresponding. net client implementation (including the source code ).

. NET client download link: http://www.rabbitmq.com/dotnet.html, the latest version 2.1.1

There are many introductions on the installation of rabbitmq (including clusters) on the linux platform on the Internet, as follows:
Http://www.javaeye.com/wiki/topic/640537: linux

The configuration in the window environment is as follows:
First download the erlang Runtime Environment (Windows binary): http://erlang.org/download.html
Select the version of the program to install, such as the http://erlang.org/download/otp_win32_R12B-5.exe

Note: The environment in this article is installed on the D Drive, for example, D: \ Program Files (x86) \ erl5.6.5.

Set the environment variables as follows:

Download RabbitMQ Server (the latest version is 2.1.1), the link is as follows: http://www.rabbitmq.com/server.html
Download and install the Windows Installation Package to drive D:
Note: source code link http://www.rabbitmq.com/releases/rabbitmq-server/v2.1.1/rabbitmq-server-2.1.1.zip

Run the above rabbitmq server program on the CMD command line:

D: \ rabbitmq \ sbin> rabbitmq-server

Activating RabbitMQ plugins...
0 plugins activated:
Starting file handle cache server... done
Starting worker pool... done
Starting database... done
Starting codec correctness check... done
-- External infrastructure ready
Starting exchange type registry... done
Starting exchange type topic... done
Starting exchange type headers... done
Starting exchange type fanout... done
Starting exchange type direct... done
Starting statistics event manager... done
Starting logging server... done
-- Kernel ready
Starting node monitor... done
Starting cluster delegate... done
Starting guid generator... done
Starting alarm handler... done
Starting memory monitor... done
-- Core initialized
Starting empty DB check... done
Starting exchange recovery... done
Starting queue supervisor and queue recovery... done
-- Message delivery logic ready
Starting error log relay... done
Starting networking... done
-- Network listeners available

Broker running


In this way, the rabbitmq server will run.

Before using rabbitmq, if you are not familiar with this project, you can take a look at the two quick links:

Get started with AMQP and RabbitMQ

Rabbitmq-Basics of 6-rabbitmq

The following uses the rabbitmqctl Console Command (located at D: \ rabbitmq \ sbin>) to configure the vhost, create a user, password, and bind permissions.

First, create vhosts. The command is as follows:
Add and create a VM:

D: \ rabbitmq \ sbin> rabbitmqctl add_vhost dnt_mq // Note: delete the virtual host rabbitmqctl delete_vhost vhostpath


All VM information can be displayed as specified below:

D: \ rabbitmq \ sbin> rabbitmqctl list_vhosts
Listing vhosts...
/(Root directory)

Add the user name and password (daizhj, password: 617595) as follows ):

D: \ rabbitmq \ sbin> rabbitmqctl add_user daizhj 617595 // Note: Modify the User Password: rabbitmqctl change_password username newpassword

Bind User Permissions:

D: \ rabbitmq \ sbin> rabbitmqctl set_permissions-p dnt_mq daizhj ".*"".*"".*"
Setting permissions for user "daizhj" in vhost "dnt_mq "...

List User Permissions:

D: \ rabbitmq \ sbin> rabbitmqctl list_user_permissions daizhj // Note: Clear the user permission rabbitmqctl clear_permissions [-p vhostpath] username
Listing permissions for user "daizhj "...
Dnt_mq. * client


Now, the rabbitmq environment configuration on a single machine is complete. In the next article, we will introduce how to use its. net client for simple development.

Link: http://www.cnblogs.com/daizhj/archive/2010/10/21/1857374.html
Tags: Rabbitmq, NET

BLOG: http://daizhj.cnblogs.com/

Author: daizhj, Dai zhenjun

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.