Step 4 — Request and reply
A call over the broker with a correlation id, a reply queue and a timeout.
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 4
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-python:0.7.12 step 4
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-ruby:0.7.14 step 4
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-dotnet:0.7.13 step 4
docker run --rm -p 15672:15672 ghcr.io/acemq-company/acemq-tutorials-go:0.9.9 step 4Side by side
| Java | Python | Ruby | .NET | Go | |
|---|---|---|---|---|---|
| Example | 11-request-and-reply |
01-request-reply |
01-request-reply |
03-request-reply-csharp |
01-request-reply |
| Request reply | Java | Python | Ruby | .NET | Go |
Java
acemq-java-amqp 0.7.15, acemq-java-amqp-examples
examples-v0.7.15.
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.12, acemq-python-amqp-examples
examples-v0.7.12.
intermediate/01-request-reply
Ten concurrent questions, each getting its own answer, and a failure reaching the caller.
Ruby
acemq-ruby-amqp 0.7.14, acemq-ruby-amqp-examples
examples-v0.7.14.
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.13, acemq-dotnet-amqp-examples
examples-v0.7.13.
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.
Go
acemq-go-amqp 0.9.9, acemq-go-amqp-examples
examples-v0.9.9.
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.