The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-URLLIB3-7267250 |
||
---|---|---|
.. | ||
order-processor | ||
README.md | ||
dapr.yaml | ||
makefile |
README.md
Dapr state management (HTTP client)
In this quickstart, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store data in a state store. See Why state management to understand when this pattern might be a good choice for your software architecture.
Visit this link for more information about Dapr and State Management.
Note: This example leverages HTTP
requests
only. If you are looking for the example using the Dapr Client SDK (recommended) click here.
This quickstart includes one service: Python service order-processor
This section shows how to run applications at once using multi-app run template files with dapr run -f .
. This enables to you test the interactions between multiple applications.
Open a new terminal window and run order-processor
using the multi app run template defined in dapr.yaml:
Run Python service with Dapr
- Open a new terminal window and navigate to
order-processor
directory:
cd ./order-processor
pip3 install -r requirements.txt
cd ..
- Run the Python service app with Dapr:
dapr run -f .
dapr stop -f .
Run a single app at a time with Dapr (Optional)
An alternative to running all or multiple applications at once is to run single apps one-at-a-time using multiple dapr run .. -- python3 app.py
commands. This next section covers how to do this.
- Run the Python service app with Dapr:
cd ./order-processor
dapr run --app-id order-processor --resources-path ../../../resources/ -- python3 app.py
dapr stop --app-id order-processor