本文介绍了RabbitMQ 的最大消息大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发布到 RabbitMQ 队列(发布/订阅模型)时消息的最大大小是多少?

What is the maximum size that a message can be when publishing to a RabbitMQ queue (pub/sub model) ?

我在文档中看不到任何明确的限制,但我认为有一些指导方针.

I can't see any explicit limits in the docs but I assume there are some guidelines.

提前致谢.

推荐答案

我在 Amazon Queue ServiceRabbitMQ 或其他流式 + 消息传递平台(如 kinesis,卡夫卡.由于 Amazon Queue Service 仅支持 min 2^10 bytes(1 Kilobytes) - max 2^18 bytes (256 Kilobytes),同样的 kinesis 也有大小限制.(不知道为什么?)

I was doing comparison between Amazon Queue Service and RabbitMQ or other streaming+messaging platforms like kinesis, kafka. As Amazon Queue Service only supports min 2^10 bytes(1 Kilobytes) - max 2^18 bytes (256 Kilobytes), similarly kinesis has size limits too. (Don't know why?)

无论如何理论上AMQueueProtocal 将处理2^64 字节.因此,即使对于大消息,RabbitMQ 也可能在单个代理中工作,肯定需要几分钟/小时才能持久化,但可能会或可能不会在代理集群中.如果节点之间的消息传输时间(60秒?)>节点之间的心跳时间,会导致集群断开和消息丢失.

Anyway In theory AMQueueProtocal would handle 2^64 bytes. So, even for a huge message, RabbitMQ might work in a single broker, definitely taking minutes/hours to persist but would or might not in a cluster of brokers. If the message transfer time between nodes (60seconds?) > heartbeat time between nodes, it will cause the cluster to disconnect and the loose the message.

这个帖子很有用 -> RabbitMQ 可以处理大消息吗?

http://grokbase.com/t/rabbitmq/rabbitmq-discuss/127wsy1h92/limiting-the-size-of-a-message

http://comments.gmane.org/gmane.comp.network.rabbitmq.general/14665

http://rabbitmq.1065348.n5.nabble.com/Max-messages-allowed-in-a-queue-in-RabbitMQ-td26063.html

https://www.rabbitmq.com/heartbeats.html

这篇关于RabbitMQ 的最大消息大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 06:14