Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.13 KB

README.md

File metadata and controls

47 lines (35 loc) · 1.13 KB

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-management

You 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:[email protected]

You can test the service by nameko shell:

nameko shell --broker amqp://guest:[email protected]
n.rpc.sale.sell(1)
  • Run api
python api.py

The api is avaible in http://localhost:5000/

License

The codebase is licensed under GPL v3.0.