quickstarts/state_management/go/sdk
Paul Yuknewicz f7c925d23c
Bump to final release 1.14.0 (#1091)
* Updating CLI and runtime versions to final 1.14.0 release

Signed-off-by: Paul Yuknewicz <paulyuk@microsoft.com>

* Updating golang quickstarts with `go get -u github.com/dapr/go-sdk@v1.11.0`

Signed-off-by: Paul Yuknewicz <paulyuk@microsoft.com>

* Updating Java quickstarts to <version>1.12.0</version>

Signed-off-by: Paul Yuknewicz <paulyuk@microsoft.com>

* Fixed up go build errors with go mod tidy

Signed-off-by: Paul Yuknewicz <paulyuk@microsoft.com>

* Dapr runtime to 1.14.1

Signed-off-by: Paul Yuknewicz <paulyuk@microsoft.com>

---------

Signed-off-by: Paul Yuknewicz <paulyuk@microsoft.com>
2024-08-14 23:37:27 -07:00
..
order-processor Bump to final release 1.14.0 (#1091) 2024-08-14 23:37:27 -07:00
README.md Merge branch 'release-1.14' of github.com:dapr/quickstarts into release-1.14-go-sdk 2024-07-27 12:33:22 -07:00
dapr.yaml Merging `release-1.12` into main branch (#952) 2023-10-13 16:10:27 -07:00
makefile Removed docker image prefix addition step 2022-07-25 12:28:57 -07:00

README.md

Dapr state management

In this quickstarts, you'll create a microservice to demonstrate Dapr's state management API. The service generates messages to store data in a state store.

Visit the Dapr documentation on State Management for more information.

Note: This example leverages the Dapr Client SDK. You can find an example using plain HTTP in the http folder.

This quickstart includes one service: Go client service order-processor

Run multiple apps with multi-app run template file

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:

  1. Run the Go service app with Dapr:
  dapr run -f  .
  1. Stop and cleanup application process
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 .. -- go run commands. This next section covers how to do this.

  1. Run the Go service app with Dapr:
cd ./order-processor
dapr run --app-id order-processor --resources-path ../../../resources/ -- go run .

The Terminal console output should look similar to this:

You're up and running! Both Dapr and your app logs will appear here.

    == APP - order-processor == Saved Order: {"orderId":1}
		== APP - order-processor == Retrieved Order: {"orderId":1}
		== APP - order-processor == Deleted Order: {"orderId":1}
		== APP - order-processor == Saved Order: {"orderId":2}
		== APP - order-processor == Retrieved Order: {"orderId":2}
		== APP - order-processor == Deleted Order: {"orderId":2}
  1. Stop and clean up application processes dapr stop --app-id order-processor