bala
bala

Reputation: 21

How does Rabbitmq fanout works internally?

We use rabbitmq in production and really happy with it. we are planning to use rabbitmq fanout feature, but would like to understand the internals.

Here are my questions:
1. When a message is fan'ed out to multiple queues, is the message copied to different queues rather than just the reference?
2. if the entire message is duplicated on all the fan'ed out queues, Is there a way to make it efficient?

Thank you,
-Bala

Upvotes: 2

Views: 235

Answers (1)

To store AMQP message content, RabbitMQ uses "binaries" which are a particular type in Erlang.

The Erlang VM only copies those binaries if they are small enough (the limit is 64 bytes if I remember correctly), otherwise, it uses reference counting. There is a chapter in the Erlang documentation about how binaries are implemented. Paragraphe 4.1 should be of interest to you.

Upvotes: 1

Related Questions