Fifth: Python's RABBITMQ message persistence

Source: Internet
Author: User
Tags rabbitmq

#测试RabbitMQ消息永久化 # #. Sub-queue persistence and Information permanence # #. This means that when the service restarts, the queues and messages are still present and can be accepted by the client. View Message Queuing commands on the server./rabbitmqctl list_queues#send Port Import pikacredentials = Pika. Plaincredentials (' root ', ' Password1 ') connection = Pika. Blockingconnection (Pika. Connectionparameters (' 10.3.151.86 ', 5672, '/', credentials)) channel = Connection.channel () channel.queue_declare ( Queue= ' Hello3 ', durable=true) #durable =true declares a queue to be persisted (after service restart) channel.basic_publish (exchange= ", routing_key= ' hell O3 ', body= ' Hello wfffforld! ', Properties=pika. Basicproperties (delivery_mode=2)) #properties =pika. Basicproperties (delivery_mode=2) to perpetuate the message (after the service restarts) Connection.close ()


This article is from the "Learning Journey" blog, so be sure to keep this source http://mingkang.blog.51cto.com/9678221/1976128

Fifth: Python RABBITMQ message Persistence

Related Article

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.