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...