In this quickstart, you'll create a microservice which makes use of Dapr's Configuration API. Configuration items are key/value pairs containing configuration data such as app ids, partition keys, database names etc. The service gets configuration items from the configuration store and subscribes for configuration updates.
Visit this link for more information about Dapr and Configuration API.
This quickstart includes one service:
- Python service
order-processor
- Locally running redis container - a redis container named
dapr_redis
is automatically created when you rundapr init
- Open a new terminal and set values for config items
orderId1
andorderId2
by using the command below
docker exec dapr_redis redis-cli MSET orderId1 "101" orderId2 "102"
- Open a new terminal window and navigate to
order-processor
directory:
cd ./order-processor
pip3 install -r requirements.txt
- Run the Python service app with Dapr:
cd ./order-processor
dapr run --app-id order-processor --resources-path ../../../components/ --app-port 6001 -- python3 app.py
- Keep the
order-processor
app running and open a separate terminal - Change the values of
orderId1
andorderId2
using the command below order-processor
app gets the updated values of config items
docker exec dapr_redis redis-cli MSET orderId1 "103" orderId2 "104"