Step 5 — Streams

An append-only log you can read from any offset, and read again.

← step 4 · step 6 →

Run it

One command, whichever language you came for. The image carries the toolchain, the library and RabbitMQ; the management UI is on http://localhost:15672 (guest/guest) while it runs, and --keep holds it open afterwards.

docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-java:0.7.15 step 5
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-python:0.7.12 step 5
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-ruby:0.7.14 step 5
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-dotnet:0.7.13 step 5
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-go:0.9.9 step 5

Side by side

Java Python Ruby .NET Go
Example 09-streams 06-streams 06-streams 07-streams-csharp 06-streams
Streams Java Python Ruby .NET Go

Java

acemq-java-amqp 0.7.15, acemq-java-amqp-examples examples-v0.7.15.

basic/09-streams

A queue is destructive: a consumer takes a message and it is gone. A stream is an append-only log the broker keeps until retention removes it. Reading one does not empty it, every reader holds its own position, and a consumer written next month can read everything written today.

Python

acemq-python-amqp 0.7.12, acemq-python-amqp-examples examples-v0.7.12.

basic/06-streams

Six readings written once and read three times, from three different places.

Ruby

acemq-ruby-amqp 0.7.14, acemq-ruby-amqp-examples examples-v0.7.14.

basic/06-streams

Six readings written once and read three times, from three different places.

.NET

acemq-dotnet-amqp 0.7.13, acemq-dotnet-amqp-examples examples-v0.7.13.

basic/07-streams-csharp

Eleven orders written to one stream and twenty-one deliveries handled out of it, by four readers who each start somewhere different.

Go

acemq-go-amqp 0.9.9, acemq-go-amqp-examples examples-v0.9.9.

basic/06-streams

Ten orders written once and read four times: a projection stopped half way and carried on, a retry the library refuses, and a reader at the end that still finds all ten.