mirror of https://github.com/dapr/java-sdk.git
Merge branch 'master' into javi-use-name-to-register-activity
This commit is contained in:
commit
432888c871
|
|
@ -83,7 +83,26 @@ public class DaprClientPropertiesTest {
|
|||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Should map DaprClient properties correctly (camelCase)")
|
||||
public void shouldMapDaprClientPropertiesCamelCase() {
|
||||
runner.withSystemProperties(
|
||||
"dapr.client.httpEndpoint=http://localhost",
|
||||
"dapr.client.httpPort=3500",
|
||||
"dapr.client.grpcEndpoint=localhost",
|
||||
"dapr.client.grpcPort=50001"
|
||||
).run(context -> {
|
||||
DaprClientProperties properties = context.getBean(DaprClientProperties.class);
|
||||
SoftAssertions.assertSoftly(softly -> {
|
||||
softly.assertThat(properties.getGrpcEndpoint()).isEqualTo("localhost");
|
||||
softly.assertThat(properties.getHttpEndpoint()).isEqualTo("http://localhost");
|
||||
softly.assertThat(properties.getHttpPort()).isEqualTo(3500);
|
||||
softly.assertThat(properties.getGrpcPort()).isEqualTo(50001);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@EnableConfigurationProperties(DaprClientProperties.class)
|
||||
|
|
|
|||
|
|
@ -56,13 +56,13 @@ This will connect to the default Dapr gRPC endpoint `localhost:50001`, requiring
|
|||
{{% alert title="Note" color="primary" %}}
|
||||
By default, the following properties are preconfigured for `DaprClient` and `DaprWorkflowClient`:
|
||||
```properties
|
||||
dapr.client.http-endpoint=http://localhost
|
||||
dapr.client.http-port=3500
|
||||
dapr.client.grpc-endpoint=localhost
|
||||
dapr.client.grpc-port=50001
|
||||
dapr.client.api-token=<Your Remote App API Token>
|
||||
dapr.client.httpEndpoint=http://localhost
|
||||
dapr.client.httpPort=3500
|
||||
dapr.client.grpcEndpoint=localhost
|
||||
dapr.client.grpcPort=50001
|
||||
dapr.client.apiToken=<your remote api token>
|
||||
```
|
||||
These values are used by default, but you can override them in your `application.properties` file to suit your environment.
|
||||
These values are used by default, but you can override them in your `application.properties` file to suit your environment. Please note that both kebab case and camel case are supported.
|
||||
{{% /alert %}}
|
||||
|
||||
You can use the `DaprClient` to interact with the Dapr APIs anywhere in your application, for example from inside a REST endpoint:
|
||||
|
|
|
|||
Loading…
Reference in New Issue