Stream Queues

Available for: LavinMQ , RabbitMQ

Stream queues are available on CloudAMQP for both RabbitMQ and LavinMQ. This page provides you with the introduction and further reading needed to get started with message streaming.

What is Message Streaming?

Streaming, or message streaming, is the term that describes the technology used to handle, process, and reprocess real-time data on-the-spot. The term is widely used in both end-user contexts and by developer communities to describe fast processing of large data volumes.

Stream Queues

In both LavinMQ and RabbitMQ, Stream queues are, as the name implies, a queue type that is declared like any other queue types. In RabbitMQ, the introduction of Stream queues was made with the 3.9 release. In LavinMQ, it was built in as a core feature at launch.

Streaming vs. Queueing

The main difference between streaming and queueing is the way data is treated after consumption, and how it's consumed. In a stream queue, messages are immutable, allowing multiple consumers to read and re-read them. In a queue, the normal state is that messages read by the consumer are then deleted from the queue. Streaming and queueing are not competing forces, rather a complement to each other for achieving multi-use case tasks under the same roof.

LavinMQ Streams

LavinMQ was launched with stream queues as a core feature. Similarities with RabbitMQ stream queues are many, but one of the differences is that with LavinMQ, communication relies entirely on the AMQP protocol, making it compatible with many existing AMQP based applications. LavinMQ documentation offers a hands-on and friendly introduction to LavinMQ streams that can be read here: LavinMQ streams guide

RabbitMQ Streams

RabbitMQ streams redrived the map of what to expect from an AMQP broker. RabbitMQ also work with the AMQP protocol, but for the best performance results, the dedicated stream protocol is recommended. More reading on RabbitMQ stream can be found in the documentation page on RabbitMQ

How do I set up streaming with CloudAMQP?

  1. You first of all need to create an instance on CloudAMQP , you can choose a LavinMQ or RabbitMQ instance.
  2. Declare streams just like queues using an AMQP client. Set x-queue-type to stream and ensure durable=true , as LavinMQ requires all streams to be durable. See code snippet below:
channel.queue_declare(
  queue='test_stream',
  durable=True,
  arguments={"x-queue-type": "stream"}
)