Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Example - Get Configuration

This example demonstrates the Configuration APIs in Dapr. It demonstrates the following APIs:

  • configuration: Get configuration from statestore

Note: Make sure to use the latest proto bindings

Pre-requisites

Install Dapr python-SDK

pip3 install dapr dapr-ext-grpc

Store the configuration in configurationstore

docker exec dapr_redis redis-cli SET orderId1 "100||1"
docker exec dapr_redis redis-cli SET orderId2 "200||1"

Run configuration example

Change directory to this folder:

cd examples/configuration

To run this example, use the following command:

dapr run --app-id configexample --resources-path components/ -- python3 configuration.py
docker exec dapr_redis redis-cli SET orderId2 "210||2"

You should be able to see the following output:

Got key=orderId1 value=100 version=1
Got key=orderId2 value=200 version=1
Subscribe key=orderId2 value=210 version=2