Step 4 — Request and reply

A call over the broker with a correlation id, a reply queue and a timeout.

← step 3 · step 5 →

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 4
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-python:0.7.17 step 4
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-ruby:0.7.19 step 4
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-dotnet:0.7.18 step 4
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-go:0.9.14 step 4
docker run --rm -p 15672:15672 -e TUTORIAL_VARIANT=vbnet ghcr.io/acemq-company/acemq-tutorials-dotnet:0.7.18 step 4   # .NET in VB.NET

Side by side

Java Python Ruby .NET Go
Example 11-request-and-reply 01-request-reply 01-request-reply 03-request-reply-csharp (VB.NET) 01-request-reply
Request reply Java Python Ruby .NET Go

Java

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

intermediate/11-request-and-reply

Asking a question over the broker and waiting for the answer: one round trip, three questions in flight at once, a caller written in another language, and a request nobody answers.

Python

acemq-python-amqp 0.7.17, acemq-python-amqp-examples examples-v0.7.17.

intermediate/01-request-reply

Ten concurrent questions, each getting its own answer, and a failure reaching the caller.

Ruby

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

intermediate/01-request-reply

Ten requests in flight at once, each getting its own answer, and a responder failure reaching the caller as an exception rather than as a timeout.

.NET

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

intermediate/03-request-reply-csharp

A question sent over a queue and the answer waited for. Three round trips: one served by a Responder, one served by hand so the reply address can be read off the message, and one nobody answers.

The VB.NET twin, intermediate/03-request-reply-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.

intermediate/01-request-reply

A price service answers requests over the broker: one caller asks for a single price, ten concurrent requests each get their own answer back on one shared reply queue, and a request the service cannot answer comes back as the service's own error rather than as a timeout.