Class WorkflowServiceStubsOptions


  • public final class WorkflowServiceStubsOptions
    extends java.lang.Object
    • Field Detail

      • DEFAULT_SERVER_LONG_POLL_RPC_TIMEOUT

        public static final java.time.Duration DEFAULT_SERVER_LONG_POLL_RPC_TIMEOUT
        RPC timeout used for all long poll calls on Temporal Server side. Long poll returns with an empty result after this server timeout.
      • DEFAULT_POLL_RPC_TIMEOUT

        public static final java.time.Duration DEFAULT_POLL_RPC_TIMEOUT
        Default RPC timeout used for all long poll calls.
      • DEFAULT_QUERY_RPC_TIMEOUT

        public static final java.time.Duration DEFAULT_QUERY_RPC_TIMEOUT
        Default RPC timeout for workflow queries
      • 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 in ManagedChannelBuilder.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

      • getDisableHealthCheck

        @Deprecated
        public boolean getDisableHealthCheck()
        Deprecated.
        ServiceStubs don't perform health check on start anymore to allow lazy connectivity. Users that prefer old behavior should explicitly call ServiceStubs.healthCheck() on client/stubs start and wait until it returns HealthCheckResponse.ServingStatus.SERVING
        Returns:
        false when client checks endpoint to make sure that the server is accessible.
      • getRpcLongPollTimeout

        public java.time.Duration getRpcLongPollTimeout()
        Returns:
        Returns the rpc timout for long poll requests.
      • getRpcQueryTimeout

        public java.time.Duration getRpcQueryTimeout()
        Returns:
        Returns the rpc timout for query workflow requests.
      • getRpcRetryOptions

        public RpcRetryOptions getRpcRetryOptions()
        Returns:
        Returns rpc retry options for outgoing requests to the temporal server that supposed to be processed and returned fast, like start workflow (not long polls or awaits for workflow finishing).
      • 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 if getSslContext() 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