Changes based on the review comments

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>
This commit is contained in:
Amulya Varote 2022-03-30 15:29:11 -07:00
parent 1eee51b153
commit 2abc6896f3
1 changed files with 6 additions and 12 deletions

View File

@ -227,24 +227,18 @@ async def executeConfiguration():
with DaprClient() as d:
CONFIG_STORE_NAME = 'configstore'
key = 'orderId'
# Wait for sidecar to be up within 20 seconds.
d.wait(20)
# Subscribe to configuration by key.
configuration = await d.subscribe_configuration(store_name=CONFIG_STORE_NAME, keys=[key], config_metadata={})
for x in range(10):
if configuration != None:
items = configuration.get_items()
for item in items:
print(f"Subscribe key={item.key} value={item.value} version={item.version}", flush=True)
else:
print("Nothing yet")
sleep(5)
if configuration != None:
items = configuration.get_items()
for item in items:
print(f"Subscribe key={item.key} value={item.value} version={item.version}", flush=True)
else:
print("Nothing yet")
asyncio.run(executeConfiguration())
```
Navigate to the directory containing the above code and run the following command to launch the application along with a Dapr sidecar:
```bash
dapr run --app-id orderprocessing --components-path components/ -- python3 OrderProcessingService.py
```