fozzy_bear_waka_waka
fozzy_bear_waka_waka

Reputation: 87

What is a message buffer?

I was reading this tutorial about RabbitMQ. In it's description of what a queue is in RabbitMQ, it says the following:

A queue is only bound by the host's memory & disk limits, it's essentially a large message buffer.

In this context, what is a message buffer? Is it a common data structure?

Upvotes: 2

Views: 4238

Answers (1)

Cosmic Ossifrage
Cosmic Ossifrage

Reputation: 5379

In this context, what is a message buffer? Is it a common data structure?

A buffer in Computer Science typically refers to a data structure or memory region which holds data temporarily while it is moved from one location to another.

You will find buffers widespread at many levels of abstraction throughout the hardware/software stack. They are especially common around interaction points with hardware devices (reading/writing data to/from software and peripherals, for example) and in networking code which writes data to/from network sockets. They are particularly useful where it is necessary to decouple a producer & consumer (different processes may read/write the buffered data, for example, or do so at different speeds) or in cases where users of a resource must queue prior to being serviced.

In the RabbitMQ context, "message buffer" refers to Rabbit's message queue data structure. A queue is a region of memory, backed by a persistent copy of messages on disk, in which RabbitMQ stores messages submitted by producers1 while it awaits a consumer to read the queue and process the message. The RabbitMQ broker acts as an intermediary to decouple the producer and consumer processes from each other.

1Of course, RabbitMQ offers its users advanced routing logic for submitted messages. Messages submitted by users may be committed directly to a queue (buffer) for delivery, or they may traverse a more complex set of routes which dynamically delivers the message to zero or more queues for delivery to multiple consumer processes.

Upvotes: 4

Related Questions