RabbitMQ: maximum size of a message

May 22, 2025•2 min read•RabbitMQ tutorial

RabbitMQ: maximum size of a message

What is the maximum size of a message in RabbitMQ?

The maximum size of a message in RabbitMQ is not defined by the protocol, but by the implementation. Unfortunately, this value is not well documented and has changed a lot over the years. We made this short article to summarize the current state of affairs.

RabbitMQ message size limits by version

  • As of version 4.0, the maximum size of a message in RabbitMQ is 16 MiB (16,777,216 bytes). Checkout the GitHub thread.
  • In version 3.9 and above, the default limit is 128 MiB (134,217,728 bytes). This limit can be bumped up to 512 MiB (536,870,912 bytes) by setting the max_message_size configuration option. See GitHub thread.
  • Before that, the limit was set to 2 GiB (2,147,483,648 bytes).

Note that because a version supports a given message size limit does not mean that it is fine to approach it. In practice, it is recommended to keep messages small and way bellow the limit (a few MiB) to avoid performance issues and memory consumption problems. See how to reduce messages size bellow.

What is the maximum number of characters in a message in RabbitMQ?

Typically, when encoding a string in UTF8, each ASCII character takes a single byte, so in version 4.0, the maximum number of characters in a message is 16,777,216 characters. However, some non-ASCII characters take more space, for instance accents or emojis. In this case, the maximum number of characters in a message can be lower since some characters take up more space.

IMPORTANT limitation of the management plugin

The RabbitMQ management plugin has a limitation that prevents it from displaying messages larger than 50,000 characters (messages are truncated). If you need to read / consume larger messages, you can use RabbitGUI instead, which does not have this limitation.

How to reduce message size in RabbitMQ?

It is usually not a good idea to send large messages in RabbitMQ, a simple way to reduce this is to store the payload in a database or an object storage service (like S3) and send a reference to it in the message, like an ID. This way, you can keep the message size small while still being able to access the full payload when needed.

This approach has the added benefit of allowing you to store large payloads in a more efficient way, as databases and object storage services are designed to handle large files and can provide better performance and scalability.

Working with RabbitMQ?

See how RabbitGUI can make your everyday RabbitMQ workflows easier.
Available on Windows, Mac, and Linux.

Try RabbitGUIRabbitGUI screenshot

Read more RabbitMQ tutorials

Properly setting up dead-letter queues in RabbitMQRabbitMQ tutorialProperly setting up dead-letter queues in RabbitMQLearn how to set up dead-letter queues in RabbitMQ, including creating a dead-letter exchange, binding it to a queue, and managing rejected messages via policiesRabbitMQ default login and passwordRabbitMQ tutorialRabbitMQ default login and passwordThe default RabbitMQ username and password are guest / guest, and they only work from localhost. Learn how to log into the Management UI on port 15672, fix rejected logins, and set credentials in Docker.RabbitMQ exponential backoff: how to retry messages with increasing delaysRabbitMQ tutorialRabbitMQ exponential backoff: how to retry messages with increasing delaysHow to implement exponential backoff retries in RabbitMQ with TTL retry queues and dead-letter exchanges. Track attempts with an x-retry-count header, choose retry delays, and send final failures to a DLQ.What is AMQP? The Advanced Message Queuing Protocol explainedRabbitMQ tutorialWhat is AMQP? The Advanced Message Queuing Protocol explainedLearn what AMQP (Advanced Message Queuing Protocol) is, how it works, its core concepts, why it powers RabbitMQ, and how it compares to alternatives like MQTT, STOMP, and Kafka.Building an event bus with RabbitMQRabbitMQ tutorialBuilding an event bus with RabbitMQLearn how to design a decoupled event bus using a RabbitMQ topic exchange, with practical routing key conventions, durable queues, and animated diagrams showing message flow.RabbitMQ Retry Pattern: How to Retry Failed MessagesRabbitMQ tutorialRabbitMQ Retry Pattern: How to Retry Failed MessagesHow to retry failed messages in RabbitMQ without infinite requeue loops. Compare retry queues with TTL, exponential backoff and the delayed message exchange, cap retry attempts, and send final failures to a dead-letter queue.