go-sdk/examples/configuration
Roberto Rojas d02f9524d9
V1.10 Update Protos & Go Modules (#356)
* updates grpc proto for v1.10

Signed-off-by: Roberto J Rojas <robertojrojas@gmail.com>

* updates go mod tidy for v1.10

Signed-off-by: Roberto J Rojas <robertojrojas@gmail.com>

---------

Signed-off-by: Roberto J Rojas <robertojrojas@gmail.com>
2023-02-01 08:35:20 -08:00
..
config fix: config api (#200) 2022-04-05 17:43:32 -07:00
README.md fix: config api (#200) 2022-04-05 17:43:32 -07:00
go.mod V1.10 Update Protos & Go Modules (#356) 2023-02-01 08:35:20 -08:00
go.sum V1.10 Update Protos & Go Modules (#356) 2023-02-01 08:35:20 -08:00
main.go update protos (#327) 2022-10-04 10:58:45 -07: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 \
         --components-path ./config/ \
         go run ./main.go

Result

  • Configuration Client Logs

The subscription event order may out of order.

get config = myConfigValue
get updated config key = mySubscribeKey1, value = mySubscribeValue1 
get updated config key = mySubscribeKey2, value = mySubscribeValue1 
get updated config key = mySubscribeKey3, value = mySubscribeValue1 
get updated config key = mySubscribeKey1, value = mySubscribeValue2 
get updated config key = mySubscribeKey2, value = mySubscribeValue2 
get updated config key = mySubscribeKey3, value = mySubscribeValue2 
get updated config key = mySubscribeKey1, value = mySubscribeValue3 
get updated config key = mySubscribeKey2, value = mySubscribeValue3 
get updated config key = mySubscribeKey3, value = mySubscribeValue3 
dapr configuration subscribe finished.
✅  Exited App successfully