A demo project showing a simple implementation of NATS using python and FastAPI.
carrier-pigeon within the dsm-portfolio architecture:
Ensure the following are setup and installed
- python (version 3.9 or later)
- poetry
- nats (or docker)
First, install the project with:
poetry install
Then, to start the FastAPI application, use the command:
poetry run uvicorn app.main:app --reload
For the app to be fully functional, you'll also need to
start NATS.
This can be done using nats-server by simply running:
nats-server
Or by using the official docker image as follows:
docker run -p 4222:4222 -it nats:latest
The running FastAPI application will be available at
localhost:8000/pigeon/
where you can play around with
NATS subject publishing and subscribing!