Skip to content

Commit

Permalink
fix config client example
Browse files Browse the repository at this point in the history
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
  • Loading branch information
mukundansundar committed Apr 21, 2023
1 parent a122c74 commit de8d85c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class ConfigurationClient {
*/
public static void main(String[] args) throws Exception {
try (DaprClient client = (new DaprClientBuilder()).build()) {
System.out.println("Using preview client...");
System.out.println("Using Dapr client...");
getConfigurations(client);
subscribeConfigurationRequest(client);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## Retrieve Configurations via Configuration API

This example provides the different capabilities provided by Dapr Java SDK for Configuration. For further information about Configuration APIs please refer to [this link](https://docs.dapr.io/developing-applications/building-blocks/configuration/)
**This API is available in Preview Mode**.

### Using the ConfigurationAPI

Expand Down Expand Up @@ -63,7 +62,7 @@ public class ConfigurationClient {
*/
public static void main(String[] args) throws Exception {
try (DaprPreviewClient client = (new DaprClientBuilder()).buildPreviewClient()) {
System.out.println("Using preview client...");
System.out.println("Using Dapr client...");
getConfigurations(client);
subscribeConfigurationRequestWithSubscribe(client);
unsubscribeConfigurationItems(client);
Expand Down Expand Up @@ -155,7 +154,7 @@ dapr run --components-path ./components/configuration --app-id configgrpc --log-

### Sample output
```
== APP == Using preview client...
== APP == Using Dapr client...
== APP == *******trying to retrieve configurations for a list of keys********
== APP == val1 : key ->myconfig1
== APP == val2 : key ->myconfig2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ConfigurationClient {
public static void main(String[] args) throws Exception {
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), DaprApiProtocol.HTTP.name());
try (DaprClient client = (new DaprClientBuilder()).build()) {
System.out.println("Using client...");
System.out.println("Using Dapr client...");
getConfigurations(client);
subscribeConfigurationRequest(client);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class ConfigurationClient {
public static void main(String[] args) throws Exception {
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), DaprApiProtocol.HTTP.name());
try (DaprPreviewClient client = (new DaprClientBuilder()).buildPreviewClient()) {
System.out.println("Using preview client...");
System.out.println("Using Dapr client...");
getConfigurations(client);
subscribeConfigurationRequest(client);
}
Expand Down Expand Up @@ -184,7 +184,7 @@ docker exec dapr_redis redis-cli MSET myconfig2 "updated_val2||1"

### Sample output
```
== APP == Using preview client...
== APP == Using Dapr client...
== APP == *******trying to retrieve configurations for a list of keys********
== APP == val1 : key ->myconfig1
== APP == val2 : key ->myconfig2
Expand Down

0 comments on commit de8d85c

Please sign in to comment.