Rabbitmq-server: the max size of a message in rabbitmq

Created on 6 May 2015  路  4Comments  路  Source: rabbitmq/rabbitmq-server

we have a problem about the max size of a message in rabbitmq.

recently, we have a problem that we sent a message with length about 220KB, however, it do not accepted by rabbitmq. So, i want to know:

1) if rabbitmq has a limit in the maximum size of a message.
2) if it does, what is the default one and how to tune that value.

mailing list material

Most helpful comment

Message size is limited to 2GB https://github.com/rabbitmq/rabbitmq-server/blob/master/include/rabbit.hrl#L137

AFAIK there's no way to tune that value.

It's better to ask these kind of questions in our mailing list https://groups.google.com/forum/#!forum/rabbitmq-users

All 4 comments

Message size is limited to 2GB https://github.com/rabbitmq/rabbitmq-server/blob/master/include/rabbit.hrl#L137

AFAIK there's no way to tune that value.

It's better to ask these kind of questions in our mailing list https://groups.google.com/forum/#!forum/rabbitmq-users

You are running into flow control/resource alarms that block publishers.

The _maximum message size_ in RabbitMQ was 2 GiB up to version 3.7:

%% Trying to send a term across a cluster larger than 2^31 bytes will
%% cause the VM to exit with "Absurdly large distribution output data
%% buffer". So we limit the max message size to 2^31 - 10^6 bytes (1MB
%% to allow plenty of leeway for the #basic_message{} and #content{}
%% wrapping the message body).
-define(MAX_MSG_SIZE, 2147383648).

Reference: https://github.com/rabbitmq/rabbitmq-common/blob/v3.7.13/include/rabbit.hrl#L279

It is now 512 MiB from version 3.8:

%% Max message size is hard limited to 512 MiB.
%% If user configures a greater rabbit.max_message_size,
%% this value is used instead.
-define(MAX_MSG_SIZE, 536870912).

Reference: https://github.com/rabbitmq/rabbitmq-common/blob/master/include/rabbit.hrl#L255

It hasn't changed because 3.8 hasn't shipped yet. The limit was lowered and the default was changed in https://github.com/rabbitmq/rabbitmq-common/pull/289.

Was this page helpful?
0 / 5 - 0 ratings