Summary of the use of RABBITMQ communication methods

Source: Internet
Author: User

When building a test framework/system, RABBITMQ was recently used, and some tools/commands were used to troubleshoot problems, and some notes were recorded here.

Installation, this is not in detail, with Yum tools such as installation (possibly Rabbitmq-server version older), the official website also has rpm package download (version can be the latest).
After installation, start can, do not elaborate.

Add user/vhost/permission settings, I did this:

The code is as follows Copy Code
Rabbitmqctl Add_user Test Test@smilejay
Rabbitmqctl Add_vhost Test_vhost
Rabbitmqctl set_permissions-p test_vhost Test ". *" ". *" ". *"



Delete a queue:

The code is as follows Copy Code

Rabbitmqadmin list Queues Name # Lists all queue
Rabbitmqadmin Delete queue name= ' QueueName ' #删除一个queue



Delete all queue, you can use the following command (will be all message/queue/vhost/user and so on all delete OH):

The code is as follows Copy Code
Rabbitmqctl Stop_app
Rabbitmqctl Reset
Rabbitmqctl Start_app



Management tools:
After you turn on administrative features with the Rabbitmq-plugins enable Rabbitmq_management command, you can use the Rabbitmqadmin command-line tool for various administrative operations.
Also, management tools provide the Web UI and HTTP APIs to manage RABBITMQ, the Web in http://192.168.222.222:15672/(IP replaced by rabbitmq-server IP).
HTTP API details, or look at the following reference documentation.
When using the Web UI, guest/guest This account password can be logged in localhost; You can set the administrator rights of a user to log in to the Web UI interface for administrative actions by using the following command.

The code is as follows Copy Code
Rabbitmqctl Add_user Admin 123456
Rabbitmqctl set_user_tags Admin Administrator
Rabbitmqctl set_permissions-p/admin ". *" ". *" ". *"



I think the Web UI and APIs are pretty good and easy to manage.

For a variety of concepts in RABBITMQ, such as: Vhost/exchange/queue, please refer to its official documentation and these two articles.

Http://deepnighttwo.com/post/rabbitmq-1.html
http://blog.csdn.net/cugb1004101218/article/details/21243927

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.