def main():
    with pika.BlockingConnection() as conn:
        channel = conn.channel()

        # Set up server

        channel.queue_declare(queue=SERVER_QUEUE,
                              exclusive=True,
                              auto_delete=True)
        channel.basic_consume(on_server_rx_rpc_request, queue=SERVER_QUEUE)


        # Set up client

        # NOTE Client must create its consumer and publish RPC requests on the
        # same channel to enable the RabbitMQ broker to make the necessary
        # associations.
        #
        # Also, client must create the consumer *before* starting to publish the
        # RPC requests.
        #
        # Client must create its consumer with no_ack=True, because the reply-to
        # queue isn't real.

        channel.basic_consume(on_client_rx_reply_from_server,
                              queue='amq.rabbitmq.reply-to',
                              no_ack=True)
        channel.basic_publish(
            exchange='',
            routing_key=SERVER_QUEUE,
            body='Marco',
            properties=pika.BasicProperties(reply_to='amq.rabbitmq.reply-to'))

        channel.start_consuming()
Here, Client sends "Marco" to RPC Server, and RPC Server replies with
dataset/ETHPy150Open pika/pika/examples/direct_reply_to.py/main