Share via


DurableTaskGrpcClientBuilder Class

  • java.lang.Object
    • com.microsoft.durabletask.DurableTaskGrpcClientBuilder

public final class DurableTaskGrpcClientBuilder

Builder class for constructing new DurableTaskClient objects that communicate with a sidecar process over gRPC.

Constructor Summary

Constructor Description
DurableTaskGrpcClientBuilder()

Method Summary

Modifier and Type Method and Description
DurableTaskClient build()

Initializes a new DurableTaskClient object with the settings specified in the current builder object.

DurableTaskGrpcClientBuilder dataConverter(DataConverter dataConverter)

Sets the DataConverter to use for converting serializable data payloads.

DurableTaskGrpcClientBuilder grpcChannel(Channel channel)

Sets the gRPC channel to use for communicating with the sidecar process.

DurableTaskGrpcClientBuilder port(int port)

Sets the gRPC endpoint port to connect to.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

DurableTaskGrpcClientBuilder

public DurableTaskGrpcClientBuilder()

Method Details

build

public DurableTaskClient build()

Initializes a new DurableTaskClient object with the settings specified in the current builder object.

Returns:

a new DurableTaskClient object

dataConverter

public DurableTaskGrpcClientBuilder dataConverter(DataConverter dataConverter)

Sets the DataConverter to use for converting serializable data payloads.

Parameters:

dataConverter - the DataConverter to use for converting serializable data payloads

Returns:

this builder object

grpcChannel

public DurableTaskGrpcClientBuilder grpcChannel(Channel channel)

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

port

public DurableTaskGrpcClientBuilder port(int 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

Applies to