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 library, the example built, its runtime 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.20 step 5
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-python:0.7.17 step 5
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-ruby:0.7.19 step 5
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-dotnet:0.7.18 step 5
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-go:0.9.14 step 5
docker run --rm -p 15672:15672 -e TUTORIAL_VARIANT=vbnet ghcr.io/acemq-company/acemq-tutorials-dotnet:0.7.18 step 5   # .NET in VB.NET

Side by side

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

Java

acemq-java-amqp 0.7.20, acemq-java-amqp-examples examples-v0.7.20.

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.17, acemq-python-amqp-examples examples-v0.7.17.

basic/06-streams

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

Ruby

acemq-ruby-amqp 0.7.19, acemq-ruby-amqp-examples examples-v0.7.19.

basic/06-streams

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

.NET

acemq-dotnet-amqp 0.7.18, acemq-dotnet-amqp-examples examples-v0.7.18.

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.

The VB.NET twin, basic/07-streams-vbnet, is the same program; -e TUTORIAL_VARIANT=vbnet runs it instead.

Go

acemq-go-amqp 0.9.14, acemq-go-amqp-examples examples-v0.9.14.

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.