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:
- Java client service
checkout
And one order processor service:
- Java order-processor service
order-processor
- Dapr and Dapr Cli.
- Java JDK 11 (or greater):
- Apache Maven version 3.x.
- Open a new terminal window and navigate to
order-processor
directory and install dependencies:
cd ./order-processor
mvn clean install
- Run the Java order-processor app with Dapr:
cd ./order-processor
dapr run --app-id order-processor --app-port 9001 --app-protocol http --dapr-http-port 3501 -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
- Open a new terminal window and navigate to
checkout
directory and install dependencies:
cd ./checkout
mvn clean install
- Run the Java checkout app with Dapr:
cd ./checkout
dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- java -jar target/CheckoutService-0.0.1-SNAPSHOT.jar
dapr stop --app-id checkout
dapr stop --app-id order-processor
- Open a new terminal window and install dependencies for
order-processor
andcheckout
apps:
cd ./order-processor
mvn clean install
cd ../checkout
mvn clean install
- Run the multi app run template:
dapr run -f .
dapr stop -f .