mirror of https://github.com/dapr/quickstarts.git
Signed-off-by: Artur Souza <asouza.pro@gmail.com> |
||
|---|---|---|
| .. | ||
| checkout | ||
| order-processor | ||
| README.md | ||
| dapr.yaml | ||
| makefile | ||
README.md
Service Invocation
In this quickstart, you'll create a checkout service and an order processor service to demonstrate how to use the service invocation API. The checkout service uses Dapr's http proxying capability to invoke a method on the order processing service.
Visit this link for more information about Dapr and service invocation.
This quickstart includes one checkout service:
- Python client service
checkout
And one order processor service:
- Python order-processor service
order-processor
Run Python order-processor with Dapr
- Install dependencies for
order-processorapp:
pip3 install -r order-processor/requirements.txt
- Run the Python order-processor app with Dapr:
dapr run --app-port 8001 --app-id order-processor --app-protocol http --dapr-http-port 3501 -- python3 order-processor/app.py
Run Python checkout with Dapr
- Open a new terminal window and install dependencies for
checkoutapp:
pip3 install -r checkout/requirements.txt
- Run the Python checkout app with Dapr:
dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- python3 checkout/app.py
dapr stop --app-id checkout
dapr stop --app-id order-processor
Start all apps with multi app run template file:
The dependencies are already installed from previous steps. Simply run the multi app run template. It uses dapr.yaml file to determine which applications to run.
dapr run -f .
Finally, stop all:
dapr stop -f .