Package io.dapr.durabletask
Class DurableTaskGrpcClientBuilder
java.lang.Object
io.dapr.durabletask.DurableTaskGrpcClientBuilder
Builder class for constructing new
DurableTaskClient objects that communicate with a sidecar process
over gRPC.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes a newDurableTaskClientobject with the settings specified in the current builder object.dataConverter(DataConverter dataConverter) Sets theDataConverterto use for converting serializable data payloads.grpcChannel(io.grpc.Channel channel) Sets the gRPC channel to use for communicating with the sidecar process.insecure(boolean insecure) Sets whether to use insecure (plaintext) mode for gRPC communication.port(int port) Sets the gRPC endpoint port to connect to.Sets the path to the TLS CA certificate file for server authentication.tlsCertPath(String tlsCertPath) Sets the path to the TLS client certificate file for client authentication.tlsKeyPath(String tlsKeyPath) Sets the path to the TLS client key file for client authentication.tracer(io.opentelemetry.api.trace.Tracer tracer) Sets the Tracer object to be used by DurableTaskClient to emit traces.
-
Constructor Details
-
DurableTaskGrpcClientBuilder
public DurableTaskGrpcClientBuilder()
-
-
Method Details
-
dataConverter
Sets theDataConverterto use for converting serializable data payloads.- Parameters:
dataConverter- theDataConverterto use for converting serializable data payloads- Returns:
- this builder object
-
grpcChannel
Sets the gRPC channel to use for communicating with the sidecar process.This builder method allows you to provide your own gRPC channel for communicating with the Durable Task sidecar endpoint. Channels provided using this method won't be closed when the client is closed. Rather, the caller remains responsible for shutting down the channel after disposing the client.
If not specified, a gRPC channel will be created automatically for each constructed
DurableTaskClient.- Parameters:
channel- the gRPC channel to use- Returns:
- this builder object
-
tracer
Sets the Tracer object to be used by DurableTaskClient to emit traces.- Parameters:
tracer- to be used by the DurableTaskClient- Returns:
- this builder object
-
port
Sets the gRPC endpoint port to connect to. If not specified, the default Durable Task port number will be used.- Parameters:
port- the gRPC endpoint port to connect to- Returns:
- this builder object
-
tlsCaPath
Sets the path to the TLS CA certificate file for server authentication. If not set, the system's default CA certificates will be used.- Parameters:
tlsCaPath- path to the TLS CA certificate file- Returns:
- this builder object
-
tlsCertPath
Sets the path to the TLS client certificate file for client authentication. This is used for mTLS (mutual TLS) connections.- Parameters:
tlsCertPath- path to the TLS client certificate file- Returns:
- this builder object
-
tlsKeyPath
Sets the path to the TLS client key file for client authentication. This is used for mTLS (mutual TLS) connections.- Parameters:
tlsKeyPath- path to the TLS client key file- Returns:
- this builder object
-
insecure
Sets whether to use insecure (plaintext) mode for gRPC communication. When set to true, TLS will be disabled and communication will be unencrypted. This should only be used for development/testing.- Parameters:
insecure- whether to use insecure mode- Returns:
- this builder object
-
build
Initializes a newDurableTaskClientobject with the settings specified in the current builder object.- Returns:
- a new
DurableTaskClientobject
-