You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example demonstrates how to set up a simple RPC (Remote Procedure Call) server and client using [Direct reply to feature](https://www.rabbitmq.com/docs/direct-reply-to).
5
+
The example is very basic the correlation id is set but not used to match responses to requests.
6
+
7
+
Setup
8
+
---
9
+
10
+
To run this example, you need to have RabbitMQ >=4.2 server running locally.
11
+
Then run the python scripts in separate terminal windows.
12
+
```bash
13
+
$ python3 server.py
14
+
connection_consumer to amqp server
15
+
Responder listening on address: /queues/rpc_queue
16
+
```
17
+
18
+
Then in another terminal window run:
19
+
```bash
20
+
$ python3 client.py
21
+
connection_consumer to amqp server
22
+
connected both publisher and consumer
23
+
consumer reply address is /queues/amq.rabbitmq.reply-to.g1h2AA5yZXBseUA2ODc4MTMzNAAAcEoAAAAAaS8eQg%3D%
24
+
```
25
+
26
+
The `rpc_queue` is the queue where the server listens for incoming RPC requests.</br>
27
+
The `amq.rabbitmq.reply-to.g1h2AA...` is a special direct-reply-to queue used by the client to receive responses.
28
+
29
+
Use standard queues for reply
30
+
===
31
+
32
+
If you want to use standard queues for replies instead of the direct-reply-to feature.
0 commit comments