Use of rabbitmq in. Net (1)-First knowledge of rabbitmq

Source: Internet
Author: User
Tags qpid
ArticleDirectory
    • 1. What is rabbitmq?
    • 2. Features of rabbitmq
    • 3. rabbitmq Installation
    • 4. Concepts of rabbitmq
    • 5. Documentation
    • 6. Client Version
1. What is rabbitmq?

Message Queue (MQ) is a type of applicationProgram. 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 MSMQ, activemq, rabbitmq, and IBM WebSphere MQ.

Rabbitmq was developed using Erlang and is open-source. It is a complete and reusable enterprise message system based on the Advanced Message Queue Protocol (amqp. He complies with the Mozilla Public License open-source protocol.

Rabbitmq 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 following links.

Rabbitmq, activemq, qpid: http://bhavin.directi.com/rabbitmq-vs-apache-activemq-vs-apache-qpid/

Rabbitmq and zeromq: http://stackoverflow.com/questions/731233/activemq-or-rabbitmq-or-zeromq-or

There are also four Message Queue competition: http://www.oschina.net/news/17973/message-queue-shootout

 

Advantages of rabbitmq:

Easy installation and deployment:

Rabbitmq is easy to install and has detailed installation documents.

Reliability:

Rabbitmq provides a variety of features that allow you to balance reliability, availability, and performance, including persistence, sending responses, and publishing confirmation.

Powerful routing functions:

All messages are forwarded to each Message Queue through a vro. rabbitmq has several commonly used vrouters built in and can complete complex routing functions through a combination of vrouters and custom vro.

Clustering:

The rabbitmq server can be deployed in a LAN cluster as a logic server.

Federation:

The federration mode enables Hot Standby deployment of the rabbitmq server. When one of the servers in the system fails and cannot operate, the other server can automatically take over the work performed by the original system.

Completing consumer:

The built-in competitive consumer model can achieve Load Balancing for consumers.

Management tools:

Rabbitmq provides an easy-to-use management interface that allows you to monitor and control all aspects of your message queue through a browser.

Tracking:

If you encounter problems when using rabbitmq or get unexpected results, you can enable the built-in tracer function for tracking. Of course, the performance will decrease.

Plug-in system:

It provides a powerful plug-in system that allows you to easily expand MQ. The management tools and Federation components mentioned above are both released as a plug-in. You can choose not to install.

Client support:

Rabbitmq supports most of the development languages you can think of, such as Java, Ruby, Python,. net, C/C ++, and Erlang.

PowerfulCommunityAnd business support:

A strong community can help you quickly solve various problems about rabbitmq. If you still cannot solve your problems, VMWare also provides commercial technical support.

3. rabbitmq Installation

Follow the official download installation manual to install http://www.rabbitmq.com/download.html

Related. Net clients can also be found at the bottom of the webpage. Some examples are provided after the client is installed. You can also use nuget in vs to add a. Net client that references rabbitmq.

4. Concepts of rabbitmq

-Connection: A Connection established with rabbitmq server. It is created by connectionfactory. Each connection is connected to only one physical server. This connection is based on a socket, this can be similar to a DB connection. Amqp generally uses TCP links to ensure message transmission reliability.

-Channel, which should be named "model" in the C # client, does not understand why the name is obtained. Other clients are basically called "channels. A channel established on the basis of connection, which is lightweight compared with connection. It is like a session in hibernate. Channels are used to define, send, obtain, and process transactions. The channel can be used in multiple threads, but it must be ensured that only one thread executes commands at any time. A connection can have multiple channels. The client program is sometimes a multi-threaded program. Every thread wants to connect to rabbitmq, but does not want to share a connection. This requirement is still common. Because a connection is a TCP link, rabbitmq does not want to maintain multiple TCP connections with each client during design, but this is indeed a requirement of some clients, therefore, the concept of channel is introduced in the design. Each channel has no connection and is completely separated. Multiple channels to share a connection.

-Exchange, which is the entity for sending messages.

-Queue: the entity that receives messages.

-Bind: connects the switch and the queue, and encapsulates the route information of the message.

5. Documentation

. Net client documentation is relatively simple, some parameters and methods are not carefully described, you can refer to the Java manual.

 

6. Client Version

this series of articles is based on rabbitmq. Net client 2.8.6.

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.