Package io.dapr.client
Class DaprClientBuilder
java.lang.Object
io.dapr.client.DaprClientBuilder
A builder for the DaprClient,
Currently only gRPC and HTTP Client will be supported.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build an instance of the Client based on the provided setup.Build an instance of the Client based on the provided setup.withObjectSerializer
(DaprObjectSerializer objectSerializer) Sets the serializer for objects to be sent and received from Dapr.withResiliencyOptions
(ResiliencyOptions options) Sets the resiliency options for DaprClient.withStateSerializer
(DaprObjectSerializer stateSerializer) Sets the serializer for objects to be persisted.
-
Constructor Details
-
DaprClientBuilder
public DaprClientBuilder()Creates a constructor for DaprClient.DefaultObjectSerializer
is used for object and state serializers by default but is not recommended for production scenarios.
-
-
Method Details
-
withObjectSerializer
Sets the serializer for objects to be sent and received from Dapr. SeeDefaultObjectSerializer
as possible serializer for non-production scenarios.- Parameters:
objectSerializer
- Serializer for objects to be sent and received from Dapr.- Returns:
- This instance.
-
withStateSerializer
Sets the serializer for objects to be persisted. SeeDefaultObjectSerializer
as possible serializer for non-production scenarios.- Parameters:
stateSerializer
- Serializer for objects to be persisted.- Returns:
- This instance.
-
withResiliencyOptions
Sets the resiliency options for DaprClient.- Parameters:
options
- Serializer for objects to be persisted.- Returns:
- This instance.
-
build
Build an instance of the Client based on the provided setup.- Returns:
- an instance of the setup Client
- Throws:
IllegalStateException
- if any required field is missing
-
buildPreviewClient
Build an instance of the Client based on the provided setup.- Returns:
- an instance of the setup Client
- Throws:
IllegalStateException
- if any required field is missing
-