RO
RobertoDebarba/microservices-python-example
A simple microservice project using Python, RabbitMQ, Nameko and Flask
Microservice example project using Python, RabbitMQ, Nameko and Flask
This a simple microservice sale and stock management system using Python, RabbitMQ, Nameko and Flask.
It's just an example, where I demonstrate the use of these technologies.
Based in Bruno Rocha tutorial.
Build and Run
Requirements
- Python 3.5.1
- Docker
Run
- Download RabbitMQ Docker image:
docker run -d --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-managementYou can see RabbitMQ dashboard in http://192.168.99.100:15672
- Install Nameko and Flask
pip install nameko
pip install flask- Run service
nameko run service --broker amqp://guest:guest@192.168.99.100You can test the service by nameko shell:
nameko shell --broker amqp://guest:guest@192.168.99.100
n.rpc.sale.sell(1)- Run api
python api.pyThe api is avaible in http://localhost:5000/
License
The codebase is licensed under GPL v3.0.
On this page
Languages
Python100.0%
Contributors
GNU General Public License v3.0
Created May 28, 2016
Updated June 3, 2024