go-sdk/examples/configuration
mikeee e45054d1f6
introduces go1.22 to tests (and misc cleanup) (#504)
* introduces go1.22

- dapr-bot updated to use go1.22
- adds go1.22 to the test jobs
- adds go1.22 to tooling tests

Signed-off-by: mikeee <hey@mike.ee>

* remove 1.20 tests

Signed-off-by: mikeee <hey@mike.ee>

* dapr-bot workflow changes

- retrieve go version from go.mod
- run go mod tidy rather than go get

Signed-off-by: mikeee <hey@mike.ee>

* bump action versions and release go version is now from go.mod

Signed-off-by: mikeee <hey@mike.ee>

* bump main and tool mod files to 1.21

Signed-off-by: mikeee <hey@mike.ee>

* fix dapr-bot test

Signed-off-by: mikeee <hey@mike.ee>

* test dapr-bot using go version from go.mod

Signed-off-by: mikeee <hey@mike.ee>

* bump action versions and remove explicit caching

Signed-off-by: mikeee <hey@mike.ee>

* bump examples to go1.21 and bump deps

Signed-off-by: mikeee <hey@mike.ee>

* bump compatibility check to 1.21 in the make flow

Signed-off-by: mikeee <hey@mike.ee>

* bump to dapr1.13rc2

Signed-off-by: mikeee <hey@mike.ee>

* tidy sums

Signed-off-by: mikeee <hey@mike.ee>

* empty commit to trigger tests (flaky example service validation)

Signed-off-by: mikeee <hey@mike.ee>

* remove conditionals for modtidy/checkdiff runs

Signed-off-by: mikeee <hey@mike.ee>

---------

Signed-off-by: mikeee <hey@mike.ee>
2024-02-08 10:08:28 -08:00
..
config fix: config api (#200) 2022-04-05 17:43:32 -07:00
README.md perf: enhanced configuration example (#483) 2023-12-28 10:19:04 +08:00
go.mod introduces go1.22 to tests (and misc cleanup) (#504) 2024-02-08 10:08:28 -08:00
go.sum introduces go1.22 to tests (and misc cleanup) (#504) 2024-02-08 10:08:28 -08:00
main.go perf: enhanced configuration example (#483) 2023-12-28 10:19:04 +08:00

README.md

Dapr Configuration Example

Step

Prepare

  • Dapr installed

Run Get Configuration

dapr run --app-id configuration-api\
         --app-protocol grpc \
         --app-port 5005 \
         --dapr-http-port 3006 \
         --log-level debug \
         --resources-path ./config/ \
         go run ./main.go

Result

  • Configuration Client Logs

The subscription event order may out of order.

got config key = mykey, value = myConfigValue

got config key = mySubscribeKey1, value = mySubscribeValue1 
got config key = mySubscribeKey2, value = mySubscribeValue1 
got config key = mySubscribeKey3, value = mySubscribeValue1 
got config key = mySubscribeKey1, value = mySubscribeValue2 
got config key = mySubscribeKey2, value = mySubscribeValue2 
got config key = mySubscribeKey3, value = mySubscribeValue2 
got config key = mySubscribeKey1, value = mySubscribeValue3 
got config key = mySubscribeKey2, value = mySubscribeValue3 
got config key = mySubscribeKey3, value = mySubscribeValue3 
got config key = mySubscribeKey1, value = mySubscribeValue4 
got config key = mySubscribeKey2, value = mySubscribeValue4 
got config key = mySubscribeKey3, value = mySubscribeValue4 
got config key = mySubscribeKey1, value = mySubscribeValue5 
got config key = mySubscribeKey2, value = mySubscribeValue5 
got config key = mySubscribeKey3, value = mySubscribeValue5 
dapr configuration subscribe finished.
dapr configuration unsubscribed
✅  Exited App successfully