Package io.dapr.durabletask
Class DurableTaskGrpcWorkerBuilder
java.lang.Object
io.dapr.durabletask.DurableTaskGrpcWorkerBuilder
Builder object for constructing customized
DurableTaskGrpcWorker instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddActivity(TaskActivityFactory factory) Adds an activity factory to be used by the constructedDurableTaskGrpcWorker.addOrchestration(TaskOrchestrationFactory factory) Adds an orchestration factory to be used by the constructedDurableTaskGrpcWorker.Sets the app ID for cross-app workflow routing.build()Initializes a newDurableTaskGrpcWorkerobject 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.maximumTimerInterval(Duration maximumTimerInterval) Sets the maximum timer interval.port(int port) Sets the gRPC endpoint port to connect to.withExecutorService(ExecutorService executorService) Sets the executor service that will be used to execute threads.
-
Constructor Details
-
DurableTaskGrpcWorkerBuilder
public DurableTaskGrpcWorkerBuilder()
-
-
Method Details
-
addOrchestration
Adds an orchestration factory to be used by the constructedDurableTaskGrpcWorker.- Parameters:
factory- an orchestration factory to be used by the constructedDurableTaskGrpcWorker- Returns:
- this builder object
-
addActivity
Adds an activity factory to be used by the constructedDurableTaskGrpcWorker.- Parameters:
factory- an activity factory to be used by the constructedDurableTaskGrpcWorker- 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 worker is closed. Rather, the caller remains responsible for shutting down the channel after disposing the worker.
If not specified, a gRPC channel will be created automatically for each constructed
DurableTaskGrpcWorker.- Parameters:
channel- the gRPC channel to use- 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
-
dataConverter
Sets theDataConverterto use for converting serializable data payloads.- Parameters:
dataConverter- theDataConverterto use for converting serializable data payloads- Returns:
- this builder object
-
maximumTimerInterval
Sets the maximum timer interval. If not specified, the default maximum timer interval duration will be used. The default maximum timer interval duration is 3 days.- Parameters:
maximumTimerInterval- the maximum timer interval- Returns:
- this builder object
-
withExecutorService
Sets the executor service that will be used to execute threads.- Parameters:
executorService-ExecutorService.- Returns:
- this builder object.
-
appId
Sets the app ID for cross-app workflow routing.This app ID is used to identify this worker in cross-app routing scenarios. It should match the app ID configured in the Dapr sidecar.
- Parameters:
appId- the app ID for this worker- Returns:
- this builder object
-
build
Initializes a newDurableTaskGrpcWorkerobject with the settings specified in the current builder object.- Returns:
- a new
DurableTaskGrpcWorkerobject
-