Before you run the example make sure local redis state store is running by executing:
docker ps- To run the example we need to first build the examples using the following command:
cargo build --examples- Insert a key with the value
helloto redis using the following command:
docker exec dapr_redis redis-cli MSET hello "world"- Run the example with dapr using the following command:
dapr run --app-id=rustapp --resources-path ../components --dapr-grpc-port 50001 -- cargo run --example configuration- Change the value of the key
helloin redis using the following command:
docker exec dapr_redis redis-cli MSET hello "world2"If everything went well you should see the following output along with dapr logs:
Configuration value: ConfigurationItem { value: "world", version: "", metadata: {} }
App subscribed to config changes with subscription id: "d383169a-0893-4c64-adde-fc3145b56d07"
Configuration value: {"hello": ConfigurationItem { value: "world2", version: "", metadata: {} }}
App unsubscribed from config changes