消息中间件 RabbitMQ 三种分布式架构区别 Clustering Federation Shovel
来源:互联网 发布:淘宝屈臣氏官方旗舰店 编辑:程序博客网 时间:2024/05/24 06:54
Distributed RabbitMQ brokers
AMQP and the other messaging protocols supported by RabbitMQ via plug-ins (e.g. STOMP), are (of course) inherently distributed - it is quite common for applications from multiple machines to connect to a single broker, even across the internet.
Sometimes however it is necessary or desirable to make the RabbitMQ broker itself distributed. There are three ways in which to accomplish that: with clustering, with federation, and using the shovel. This page explains the purpose of each approach.
Note that you do not need to pick a single approach - you can connect clusters together with federation, or the shovel, or both.
Clustering
Clustering connects multiple machines together to form a single logical broker. Communication is via Erlang message-passing, so all nodes in the cluster must have the same Erlang cookie. The network links between machines in a cluster must be reliable, and all machines in the cluster must run the same versions of RabbitMQ and Erlang.
Virtual hosts, exchanges, users, and permissions are automatically mirrored across all nodes in a cluster. Queues may be located on a single node, or mirrored across multiple nodes. A client connecting to any node in a cluster can see all queues in the cluster, even if they are not located on that node.
Typically you would use clustering for high availability and increased throughput, with machines in a single location.
Federation
Federation allows an exchange or queue on one broker to receive messages published to an exchange or queue on another (the brokers may be individual machines, or clusters). Communication is via AMQP (with optional SSL), so for two exchanges or queues to federate they must be granted appropriate users and permissions.
Federated exchanges are connected with one way point-to-point links. By default, messages will only be forwarded over a federation link once, but this can be increased to allow for more complex routing topologies. Some messages may not be forwarded over the link; if a message would not be routed to a queue after reaching the federated exchange, it will not be forwarded in the first place.
Federated queues are similarly connected with one way point-to-point links. Messages will be moved between federated queues an arbitrary number of times to follow the consumers.
Typically you would use federation to link brokers across the internet for pub/sub messaging and work queueing.
The Shovel
Connecting brokers with the shovel is conceptually similar to connecting them with federation. However, the shovel works at a lower level.
Whereas federation aims to provide opinionated distribution of exchanges and queues, the shovel simply consumes messages from a queue on one broker, and forwards them to an exchange on another.
Typically you would use the shovel to link brokers across the internet when you need more control than federation provides.
Dynamic shovels can also be useful for moving messages around in an ad-hoc manner on a single broker.
Summary
- 消息中间件 RabbitMQ 三种分布式架构区别 Clustering Federation Shovel
- 消息中间件 rabbitmq 级联-Shovel
- 消息中间件 rabbitmq 级联-Federation
- 消息中间件RabbitMQ
- 消息中间件之RabbitMQ
- 消息中间件RabbitMQ 初探
- 使用rabbitmq消息中间件
- rabbitMQ消息中间件
- 搭建JEESZ分布式架构9--消息中间件简介
- 分布式消息中间件--kafka
- kafka分布式消息中间件
- 分布式之消息中间件
- 分布式 消息中间件简介
- 分布式消息中间件-Rocketmq
- 什么是分布式消息中间件?
- 消息中间件RabbitMQ-实战一
- 消息中间件以及RabbitMQ简介
- MQ消息中间件在分布式系统中的作用(三)
- 音视频学习路线 知乎答主
- 消息中间件 rabbitmq 级联-Federation
- stdin,stdout,stderr
- js开发: JavaScript 中的面向对象的初步理解
- matplotlib绘图基础--1
- 消息中间件 RabbitMQ 三种分布式架构区别 Clustering Federation Shovel
- 安装GeoServer并配置数据存储
- 两栈共享空间
- 3DS更新R4烧录卡内核
- 数据库的查询优化技术
- VS2015使用MFC编程时struct结构变量报错
- 售前
- stdin,stdout,stderr
- 常见的原始JS选择器使用方法总结