Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
RabbitMQ Essentials

You're reading from   RabbitMQ Essentials Build distributed and scalable applications with message queuing using RabbitMQ

Arrow left icon
Product type Paperback
Published in Aug 2020
Publisher Packt
ISBN-13 9781789131666
Length 154 pages
Edition 2nd Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Lovisa Johansson Lovisa Johansson
Author Profile Icon Lovisa Johansson
Lovisa Johansson
David Dossot David Dossot
Author Profile Icon David Dossot
David Dossot
Arrow right icon
View More author details
Toc

Reply-to queues and RPC

The CC application can now communicate in a good way between the publisher and the consumer, but what if a function has to run on a remote computer and wait for the result? Hardcoding an exchange and routing key in the service to publish responses isn't possible as it would be too inflexible. The solution is to have the request message carry the coordinates of the location where the response should be sent, a pattern commonly known as RPC.

The application service calls a specific function residing on the taxi application, and the taxi sends the result to the end user. The request message carries the name of the queue where the response should be sent. The AMQP protocol supports this mechanism out of the box. The client can store the queue name of the location where the response must be sent.

When RabbitMQ delivers a message to the consumer, it will change the reply-to property. The server can reply to the message from the publisher by sending a message to...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime