First of all, let's install RabbitMQ. In my case, I use Ubuntu 15.04, here are the steps for installing RabbitMQ:
- sudo apt-get install rabbitmq-server
On python side, I've used a lib called Pika. I've made the installation using pip, here is the command:
- pip install pika
The codeThe example shown below is divided into three parts: sender, receiver and main program exploring the basic features in a simple and clear code.
Concluding, the intent of this post was to show a way of working with messaging and python. This example was simple, but it's a good start point for who wants to play with messaging and python. Particularly I love python programming, it was a nice experience and I pretend to evolve more this example, showing advanced features and more fun things.
You can check the code on my github: https://github.com/marcelocure/sandbox/tree/master/python/python_messaging