search
HomeBackend DevelopmentPHP TutorialRabbitMQ-Introduction to mirror queue configuration

This article brings you an introduction to RabbitMQ-mirror queue configuration. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Set policy method

RabbitMQ-Introduction to mirror queue configuration

For example, we set the queue that satisfies the rule "*_mirrored_queue" as a mirror queue
./ rabbitmqctl set_policy -p wenda-action mirrored_queue_policy_all ".*_mirrored_queue" '{"ha-mode":"all"}'
All queues that meet the "*_mirrored_queue" rule applied after are mirrored queues

tips: Testing shows that you can set up a mirror queue using the regular rules of the policy. If the policy is not set, the mirror queue set using the x-ha-policy parameter when declaring the queue (queue_declare method) is invalid. If the policy regular rules are set and the x-ha-policy parameter is not used, the queue that meets the regular rules will automatically become a mirror queue. (Many blogs explain how to use the x-ha-policy parameter of the queue to set the mirror queue. But it does not specify that policy rules need to be created in advance).

rabbitmq documentation description:

RabbitMQ-Introduction to mirror queue configuration

#Synchronization mechanism of mirror queue

When a queue is declared as a mirror queue , and ha-mode:all, all nodes in the cluster will have a mirror of the queue. When the queue already has some data, add a new node to the cluster. After the new node joins the cluster, a mirror of the queue will be automatically created, but The queue had data before. Should the data be synchronized to the new node immediately or manually? At this time, the synchronization mechanism of the mirror queue is required.
The arg parameter in the queue_declare() method has this configuration:
ha-sync-mode manual manual synchronization | automatic automatic synchronization

tips: When a queue is being synchronized, all operations to change the queue will be blocked, which may be blocked for minutes, hours or even days due to various reasons. (So ​​be careful when synchronizing queues)

The above is the detailed content of RabbitMQ-Introduction to mirror queue configuration. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:segmentfault. If there is any infringement, please contact admin@php.cn delete
如何在PHP中使用RabbitMQ实现分布式消息处理如何在PHP中使用RabbitMQ实现分布式消息处理Jul 18, 2023 am 11:00 AM

如何在PHP中使用RabbitMQ实现分布式消息处理引言:在大规模应用程序开发中,分布式系统已成为一个常见的需求。分布式消息处理是这样的一种模式,通过将任务分发到多个处理节点,可以提高系统的效率和可靠性。RabbitMQ是一个开源的,可靠的消息队列系统,它采用AMQP协议来实现消息的传递和处理。在本文中,我们将介绍如何在PHP中使用RabbitMQ来实现分布

在Go语言中使用RabbitMQ:完整指南在Go语言中使用RabbitMQ:完整指南Jun 19, 2023 am 08:10 AM

随着现代应用程序的复杂性增加,消息传递已成为一种强大的工具。在这个领域,RabbitMQ已成为一个非常受欢迎的消息代理,可以用于在不同的应用程序之间传递消息。在这篇文章中,我们将探讨如何在Go语言中使用RabbitMQ。本指南将涵盖以下内容:RabbitMQ简介RabbitMQ安装RabbitMQ基础概念Go语言中的RabbitMQ入门RabbitMQ和Go

SpringBoot怎么整合RabbitMQ实现延迟队列SpringBoot怎么整合RabbitMQ实现延迟队列May 16, 2023 pm 08:31 PM

如何保证消息不丢失rabbitmq消息投递路径生产者->交换机->队列->消费者总的来说分为三个阶段。1.生产者保证消息投递可靠性。2.mq内部消息不丢失。3.消费者消费成功。什么是消息投递可靠性简单点说就是消息百分百发送到消息队列中。我们可以开启confirmCallback生产者投递消息后,mq会给生产者一个ack.根据ack,生产者就可以确认这条消息是否发送到mq.开启confirmCallback修改配置文件#NONE:禁用发布确认模式,是默认值,CORRELATED:

go-zero与RabbitMQ的应用实践go-zero与RabbitMQ的应用实践Jun 23, 2023 pm 12:54 PM

现在越来越多的企业开始采用微服务架构模式,而在这个架构中,消息队列成为一种重要的通信方式,其中RabbitMQ被广泛应用。而在go语言中,go-zero是近年来崛起的一种框架,它提供了很多实用的工具和方法,让开发者更加轻松地使用消息队列,下面我们将结合实际应用,来介绍go-zero和RabbitMQ的使用方法和应用实践。1.RabbitMQ概述Rabbit

Swoole与RabbitMQ集成实践:打造高可用性消息队列系统Swoole与RabbitMQ集成实践:打造高可用性消息队列系统Jun 14, 2023 pm 12:56 PM

随着互联网时代的到来,消息队列系统变得越来越重要。它可以使不同的应用之间实现异步操作、降低耦合度、提高可扩展性,进而提升整个系统的性能和用户体验。在消息队列系统中,RabbitMQ是一个强大的开源消息队列软件,它支持多种消息协议、被广泛应用于金融交易、电子商务、在线游戏等领域。在实际应用中,往往需要将RabbitMQ和其他系统进行集成。本文将介绍如何使用sw

Golang中使用RabbitMQ实现任务分发与负载均衡的策略Golang中使用RabbitMQ实现任务分发与负载均衡的策略Sep 27, 2023 am 11:22 AM

Golang中使用RabbitMQ实现任务分发与负载均衡的策略概述:在分布式系统中,任务的分发与负载均衡是非常重要的。一种常见的解决方案是使用消息队列来实现任务的分发与处理。本文将介绍如何使用Golang和RabbitMQ实现任务的分发与负载均衡的策略,并提供具体的代码示例。RabbitMQ简介:RabbitMQ是一个可靠、可扩展、开放源代码的消息中间件,它

SpringBoot怎么整合RabbitMQ处理死信队列和延迟队列SpringBoot怎么整合RabbitMQ处理死信队列和延迟队列May 15, 2023 pm 03:28 PM

简介RabbitMQ消息简介RabbitMQ的消息默认不会超时。什么是死信队列?什么是延迟队列?死信队列:DLX,全称为Dead-Letter-Exchange,可以称之为死信交换器,也有人称之为死信邮箱。当消息在一个队列中变成死信(deadmessage)之后,它能被重新被发送到另一个交换器中,这个交换器就是DLX,绑定DLX的队列就称之为死信队列。以下几种情况会导致消息变成死信:消息被拒绝(Basic.Reject/Basic.Nack),并且设置requeue参数为false;消息过期;队

PHP开发:使用 RabbitMQ 实现任务队列PHP开发:使用 RabbitMQ 实现任务队列Jun 15, 2023 pm 05:33 PM

随着互联网的不断发展,网站的流量越来越大,访问量的增长带来的问题也越来越多。当用户量过大时,服务器负载会增大,这时就需要使用一些技术手段来解决这些问题。任务队列就是其中的一种方式,可以将一些耗时的操作异步执行,从而缓解服务器压力。本文将介绍如何使用RabbitMQ实现任务队列。一、什么是RabbitMQRabbitMQ是一个开源的消息中间件,它实现了

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool