1、服务器端代码:
https://github.com/rabbitmq/rabbitmq-tutorials/blob/master/python/rpc_server.py
2、客户端代码:
https://github.com/rabbitmq/rabbitmq-tutorials/blob/master/python/rpc_client.py
3、启动服务时,若出现如下错误时:
Traceback (most recent call last):
File "rpc_server.py", line 2, in <module>
import pika
ImportError: No module named pika
4、在ubuntu终端下执行:
sudo pip install pika==0.9.5
sudo apt-get install python-pip git-core
5、问题解决。