quickstarts/service_invocation/python/http
Artur Souza 9929fc66c9 Pinning dapr version and fixes validations.
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-02-07 14:48:40 -08:00
..
checkout Add Resiliency Quickstarts for Service Invoke and State Management (#744) 2022-11-16 14:57:45 -08:00
order-processor Added csharp to the workflows 2022-08-29 14:52:05 -07:00
README.md Pinning dapr version and fixes validations. 2023-02-07 14:48:40 -08:00
dapr.yaml Pinning dapr version and fixes validations. 2023-02-07 14:48:40 -08:00
makefile Removed docker image prefix addition step 2022-07-25 12:28:57 -07:00

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

  1. Install dependencies for order-processor app:
pip3 install -r order-processor/requirements.txt 
  1. 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

  1. Open a new terminal window and install dependencies for checkout app:
pip3 install -r checkout/requirements.txt 
  1. 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 .