Package io.temporal.serviceclient
Class ServiceStubsOptions
- java.lang.Object
-
- io.temporal.serviceclient.ServiceStubsOptions
-
- Direct Known Subclasses:
OperatorServiceStubsOptions
,WorkflowServiceStubsOptions
public class ServiceStubsOptions extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServiceStubsOptions.Builder<T extends ServiceStubsOptions.Builder<T>>
-
Field Summary
Fields Modifier and Type Field Description protected io.grpc.ManagedChannel
channel
protected java.util.function.Consumer<io.grpc.ManagedChannelBuilder<?>>
channelInitializer
protected java.time.Duration
connectionBackoffResetFrequency
Frequency at which connection backoff is going to be resetstatic java.time.Duration
DEFAULT_CONNECTION_BACKOFF_RESET_FREQUENCY
Default timeout that will be used to reset connection backoff.static java.time.Duration
DEFAULT_GRPC_RECONNECT_FREQUENCY
Default timeout that will be used to enter idle channel state and reconnect to temporal server.static java.lang.String
DEFAULT_LOCAL_DOCKER_TARGET
static java.time.Duration
DEFAULT_RPC_TIMEOUT
Default RPC timeout used for all non-long-poll and non-query calls.protected boolean
enableHttps
Indicates whether basic HTTPS/SSL/TLS should be enabled *protected boolean
enableKeepAlive
Enables keep alive ping from client to the server, which can help drop abruptly closed connections faster.protected java.util.Collection<io.grpc.ClientInterceptor>
grpcClientInterceptors
gRPC client interceptors to be added to gRPC channelprotected java.util.Collection<GrpcMetadataProvider>
grpcMetadataProviders
gRPC metadata/headers providers to be called on each gRPC request to supply additional headersprotected java.time.Duration
grpcReconnectFrequency
Frequency at which grpc connection channel will be moved into an idle state, triggering a new connection to the temporal frontend host.protected io.grpc.Metadata
headers
Optional gRPC headersprotected java.time.Duration
healthCheckAttemptTimeout
HealthCheckAttemptTimeout specifies how to long to wait for service response on each health check attempt.protected java.time.Duration
healthCheckTimeout
HealthCheckTimeout defines how long client should be sending health check requests to the server before concluding that it is unavailable.protected boolean
keepAlivePermitWithoutStream
If true, keep alive ping will be allowed when there are no active RPCs.protected java.time.Duration
keepAliveTime
Interval at which server will be pinged in order to determine if connections are still alive.protected java.time.Duration
keepAliveTimeout
Amount of time that client would wait for the keep alive ping response from the server before closing the connection.protected com.uber.m3.tally.Scope
metricsScope
protected java.time.Duration
rpcTimeout
The gRPC timeoutprotected io.grpc.netty.shaded.io.netty.handler.ssl.SslContext
sslContext
The user provided context for SSL/TLS over gRPC *protected java.lang.String
target
target string to use for connection/channel inManagedChannelBuilder.forTarget(String)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.grpc.ManagedChannel
getChannel()
java.util.function.Consumer<io.grpc.ManagedChannelBuilder<?>>
getChannelInitializer()
Gives an opportunity to provide some additional configuration to the channel builder or override configurations done by the Temporal Stubs.java.time.Duration
getConnectionBackoffResetFrequency()
boolean
getEnableHttps()
boolean
getEnableKeepAlive()
java.util.Collection<io.grpc.ClientInterceptor>
getGrpcClientInterceptors()
java.util.Collection<GrpcMetadataProvider>
getGrpcMetadataProviders()
java.time.Duration
getGrpcReconnectFrequency()
io.grpc.Metadata
getHeaders()
java.time.Duration
getHealthCheckAttemptTimeout()
java.time.Duration
getHealthCheckTimeout()
boolean
getKeepAlivePermitWithoutStream()
java.time.Duration
getKeepAliveTime()
java.time.Duration
getKeepAliveTimeout()
com.uber.m3.tally.Scope
getMetricsScope()
java.time.Duration
getRpcTimeout()
io.grpc.netty.shaded.io.netty.handler.ssl.SslContext
getSslContext()
java.lang.String
getTarget()
-
-
-
Field Detail
-
DEFAULT_LOCAL_DOCKER_TARGET
public static final java.lang.String DEFAULT_LOCAL_DOCKER_TARGET
- See Also:
- Constant Field Values
-
DEFAULT_RPC_TIMEOUT
public static final java.time.Duration DEFAULT_RPC_TIMEOUT
Default RPC timeout used for all non-long-poll and non-query calls.
-
DEFAULT_CONNECTION_BACKOFF_RESET_FREQUENCY
public static final java.time.Duration DEFAULT_CONNECTION_BACKOFF_RESET_FREQUENCY
Default timeout that will be used to reset connection backoff.
-
DEFAULT_GRPC_RECONNECT_FREQUENCY
public static final java.time.Duration DEFAULT_GRPC_RECONNECT_FREQUENCY
Default timeout that will be used to enter idle channel state and reconnect to temporal server.
-
channel
protected final io.grpc.ManagedChannel channel
-
target
protected final java.lang.String target
target string to use for connection/channel inManagedChannelBuilder.forTarget(String)
-
channelInitializer
@Nullable protected final java.util.function.Consumer<io.grpc.ManagedChannelBuilder<?>> channelInitializer
-
enableHttps
protected final boolean enableHttps
Indicates whether basic HTTPS/SSL/TLS should be enabled *
-
sslContext
protected final io.grpc.netty.shaded.io.netty.handler.ssl.SslContext sslContext
The user provided context for SSL/TLS over gRPC *
-
healthCheckAttemptTimeout
protected final java.time.Duration healthCheckAttemptTimeout
HealthCheckAttemptTimeout specifies how to long to wait for service response on each health check attempt. Default: 5s.
-
healthCheckTimeout
protected final java.time.Duration healthCheckTimeout
HealthCheckTimeout defines how long client should be sending health check requests to the server before concluding that it is unavailable. Defaults to 10s.
-
enableKeepAlive
protected final boolean enableKeepAlive
Enables keep alive ping from client to the server, which can help drop abruptly closed connections faster.
-
keepAliveTime
protected final java.time.Duration keepAliveTime
Interval at which server will be pinged in order to determine if connections are still alive.
-
keepAliveTimeout
protected final java.time.Duration keepAliveTimeout
Amount of time that client would wait for the keep alive ping response from the server before closing the connection.
-
keepAlivePermitWithoutStream
protected final boolean keepAlivePermitWithoutStream
If true, keep alive ping will be allowed when there are no active RPCs.
-
rpcTimeout
protected final java.time.Duration rpcTimeout
The gRPC timeout
-
connectionBackoffResetFrequency
protected final java.time.Duration connectionBackoffResetFrequency
Frequency at which connection backoff is going to be reset
-
grpcReconnectFrequency
protected final java.time.Duration grpcReconnectFrequency
Frequency at which grpc connection channel will be moved into an idle state, triggering a new connection to the temporal frontend host.
-
headers
protected final io.grpc.Metadata headers
Optional gRPC headers
-
grpcMetadataProviders
protected final java.util.Collection<GrpcMetadataProvider> grpcMetadataProviders
gRPC metadata/headers providers to be called on each gRPC request to supply additional headers
-
grpcClientInterceptors
protected final java.util.Collection<io.grpc.ClientInterceptor> grpcClientInterceptors
gRPC client interceptors to be added to gRPC channel
-
metricsScope
protected final com.uber.m3.tally.Scope metricsScope
-
-
Method Detail
-
getChannel
public io.grpc.ManagedChannel getChannel()
- Returns:
- fully custom user-configured externally provided gRPC channel to use
- See Also:
ServiceStubsOptions.Builder.setChannel(ManagedChannel)
-
getTarget
public java.lang.String getTarget()
- Returns:
- the target string to use for connection/channel in
ManagedChannelBuilder.forTarget(String)
-
getChannelInitializer
@Nullable public java.util.function.Consumer<io.grpc.ManagedChannelBuilder<?>> getChannelInitializer()
Gives an opportunity to provide some additional configuration to the channel builder or override configurations done by the Temporal Stubs.Advanced API
- Returns:
- listener that will be called as a last step of channel creation if the channel is
configured by
ServiceStubsOptions.Builder.setTarget(String)
.
-
getEnableHttps
public boolean getEnableHttps()
- Returns:
- if gRPC should use SSL/TLS; Ignored and assumed
true
ifgetSslContext()
is set
-
getSslContext
public io.grpc.netty.shaded.io.netty.handler.ssl.SslContext getSslContext()
- Returns:
- the gRPC SSL Context to use
-
getHealthCheckAttemptTimeout
public java.time.Duration getHealthCheckAttemptTimeout()
- Returns:
- how to long to wait for service response on each health check attempt
-
getHealthCheckTimeout
public java.time.Duration getHealthCheckTimeout()
- Returns:
- duration of time to wait while checking server connection when creating new client
-
getEnableKeepAlive
public boolean getEnableKeepAlive()
- Returns:
- true if ping from client to the server is enabled, which can help detect and drop abruptly closed connections faster
-
getKeepAliveTime
public java.time.Duration getKeepAliveTime()
- Returns:
- interval at which server will be pinged in order to determine if connections are still alive
-
getKeepAliveTimeout
public java.time.Duration getKeepAliveTimeout()
- Returns:
- amount of time that client would wait for the keep alive ping response from the server before closing the connection
-
getKeepAlivePermitWithoutStream
public boolean getKeepAlivePermitWithoutStream()
- Returns:
- if keep alive ping will be allowed when there are no active RPCs
-
getRpcTimeout
public java.time.Duration getRpcTimeout()
- Returns:
- the rpc timeout value
-
getConnectionBackoffResetFrequency
public java.time.Duration getConnectionBackoffResetFrequency()
- Returns:
- frequency at which connection backoff should be reset or null if backoff reset is disabled
-
getGrpcReconnectFrequency
public java.time.Duration getGrpcReconnectFrequency()
- Returns:
- frequency at which grpc channel should be moved into an idle state
-
getHeaders
public io.grpc.Metadata getHeaders()
- Returns:
- gRPC headers to be added to every call
-
getGrpcMetadataProviders
public java.util.Collection<GrpcMetadataProvider> getGrpcMetadataProviders()
- Returns:
- gRPC metadata/headers providers to be called on each gRPC request to supply additional headers
-
getGrpcClientInterceptors
public java.util.Collection<io.grpc.ClientInterceptor> getGrpcClientInterceptors()
- Returns:
- gRPC client interceptors to be added to gRPC channel
-
getMetricsScope
@Nonnull public com.uber.m3.tally.Scope getMetricsScope()
- Returns:
- scope to be used for metrics reporting
-
-