- Method Name:
getConfiguration
- Input Type:
GetConfigurationRequest
- Output Type:
GetConfigurationResponse
- Since:
1.5
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
storeName |
string |
Y | The name of configuration store. | |
keys |
array of string |
N | null |
The key of the configuration item to fetch. |
metadata |
map of string to string |
N | null |
The metadata which can be sent to configuration store components. |
- If a list of keys is provided, only query for the corresponding configuration items.
- Empty list of keys means fetch all configuration items for this storeName.
Name | Type | Description |
---|---|---|
items |
map of string to configurationItem |
It is the response containing the list of configuration items against respective keys. |
Name | Type | Description |
---|---|---|
value |
string |
The value of configuration item. |
version |
string |
The version of configuration item. |
metadata |
map of string to string |
The metadata which will be passed to/from configuration store component. |
Case | Error Message | Expected result |
---|---|---|
Invalid Argument | Configuration stores not configured |
Returns error without result object |
Error Getting Configurations | Failed to get from Configuration store |
Returns error without result object |
None.
None.
- Method Name:
subscribeConfiguration
- Input Type:
SubscribeConfigurationRequest
- Output Type:
SubscribeConfigurationStream
- Since:
1.5
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
storeName |
string |
Y | The name of configuration store. | |
keys |
array of string |
N | null |
The key of the configuration item to subscribe. |
metadata |
map of string to string |
N | null |
The metadata which can be sent to configuration store components. |
callback |
user defined func / handler | N | Callback for every incoming event. |
- If a list of keys is provided, only subscribe for the corresponding configuration items.
- Empty list of keys means subscribing to all configuration items for this storeName.
Name | Type | Description |
---|---|---|
id |
string |
It is the id corresponding to this subscription, can be used to stop this subscription. |
items |
map of string to configurationItem |
It is the response containing the list of updated configuration items. Instead of asking for a handler, sdk can decide to supply back events on this stream and let user process them. |
SubscribeConfigurationStream
can just return once and an id
contained in it, as id can be later used by App to unsubscribe. OR SubscribeConfigurationStream
can be a stream of items / events.
SubscribeConfigurationStream
can also optionally provide a function stop
to let App call it when willing to unsubscribe.
Name | Type | Description |
---|---|---|
value |
string |
The value of configuration item. |
version |
string |
The version of configuration item. |
metadata |
map of string to string |
The metadata which will be passed to/from configuration store component. |
- Basically, as a result of successful subscription, a stream of SubscribeConfigurationResponse is opened.
- If subscription is successful, the subscription id is provided in response.
- With each successful update to configuration key/value items, SubscribeConfigurationResponse is streamed across.
Case | Error Message | Expected result |
---|---|---|
Invalid Argument | Configuration stores not configured |
Returns error without result object |
Error Subscribing To Configurations | Failed to subscribe from Configuration store |
Returns error without result object |
A separate handler may need to be implemented, depending on sdk implementation. This handler, if required, would be responsible to process events received at /configuration/{configStore}/{key}
.
None.
-
SDKs can chose to EITHER store subscription ids in a collection and allow users to call
Unsubscribe Configuration
OR they can chose to give a handle withSubscribe Configuration
API, where-in the handle can be used by users to invoke unsubscribe/stop, in the later case handle internally would take care of callingUnsubscribe Configuration
with corresponding subscription id. -
Method Name:
unsubscribeConfiguration
-
Input Type:
UnsubscribeConfigurationRequest
-
Output Type:
UnsubscribeConfigurationResponse
-
Since:
1.7
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
storeName |
string |
Y | The name of configuration store. | |
id |
string |
Y | It is the id corresponding to this subscription, can be used to stop this subscription. |
Name | Type | Description |
---|---|---|
ok |
bool |
Represents whether this unsubscription was successful or not. |
message |
string |
Message giving information about the reason of failure, if any. |
Case | Error Message | Expected result |
---|---|---|
Invalid Argument | Configuration stores not configured |
Returns error without result object |
Error Unsubscribing To Configurations | Failed to unsubscribe from Configuration store |
Returns error without result object |
None.
None.
- Building Block Overview: Configuration Store
- Building Block's Dapr API Reference (not the SDK API): Configuration Store Dapr API