Class ClientOptions.Builder

  • Enclosing class:
    ClientOptions

    public static class ClientOptions.Builder
    extends java.lang.Object
    Builder is the builder for ClientOptions.
    • Method Detail

      • setGRPCChannel

        public ClientOptions.Builder setGRPCChannel​(io.grpc.ManagedChannel gRPCChannel)
        Sets gRPC channel to use. Exclusive with host and port.
      • setRpcTimeout

        public ClientOptions.Builder setRpcTimeout​(long timeoutMillis)
        Sets the rpc timeout value for non query and non long poll calls. Default is 1000.
        Parameters:
        timeoutMillis - timeout, in millis.
      • setRpcLongPollTimeout

        public ClientOptions.Builder setRpcLongPollTimeout​(long timeoutMillis)
        Sets the rpc timeout value for the following long poll based operations: PollForDecisionTask, PollForActivityTask, GetWorkflowExecutionHistory. Should never be below 60000 as this is server side timeout for the long poll. Default is 61000.
        Parameters:
        timeoutMillis - timeout, in millis.
      • setQueryRpcTimeout

        public ClientOptions.Builder setQueryRpcTimeout​(long timeoutMillis)
        Sets the rpc timeout value for query calls. Default is 10000.
        Parameters:
        timeoutMillis - timeout, in millis.
      • setListArchivedWorkflowRpcTimeout

        public ClientOptions.Builder setListArchivedWorkflowRpcTimeout​(long timeoutMillis)
        Sets the rpc timeout value for query calls. Default is 180000.
        Parameters:
        timeoutMillis - timeout, in millis.
      • getFeatureFlags

        public FeatureFlags getFeatureFlags()
        Returns the feature flags defined in ClientOptions
      • setFeatureFlags

        public ClientOptions.Builder setFeatureFlags​(FeatureFlags featureFlags)
        Sets the feature flags to turn on/off some Cadence features By default, all features under FeatureFlags are turned off.
        Parameters:
        featureFlags - FeatureFlags
      • setClientAppName

        public ClientOptions.Builder setClientAppName​(java.lang.String clientAppName)
        Sets the client application name.

        This name will be used as the tchannel client service name. It will also be reported as a tag along with metrics emitted to m3.

        Parameters:
        clientAppName - String representing the client application name.
        Returns:
        Builder for ClentOptions
      • setServiceName

        public ClientOptions.Builder setServiceName​(java.lang.String serviceName)
        Sets the service name that Cadence service was started with.
        Parameters:
        serviceName - String representing the service name
        Returns:
        Builder for ClentOptions
      • setMetricsScope

        public ClientOptions.Builder setMetricsScope​(com.uber.m3.tally.Scope metricsScope)
        Sets the metrics scope to be used for metrics reporting.
        Parameters:
        metricsScope -
        Returns:
        Builder for ClentOptions
      • setTransportHeaders

        public ClientOptions.Builder setTransportHeaders​(java.util.Map<java.lang.String,​java.lang.String> transportHeaders)
        Sets additional transport headers for tchannel client.
        Parameters:
        transportHeaders - Map with additional transport headers
        Returns:
        Builder for ClentOptions
      • setHeaders

        public ClientOptions.Builder setHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
      • setIsolationGroup

        public ClientOptions.Builder setIsolationGroup​(java.lang.String isolationGroup)
        Sets the isolation group to be used for matching.
        Parameters:
        isolationGroup -
        Returns:
        Builder for ClentOptions
      • build

        public ClientOptions build()
        Builds and returns a ClientOptions object.
        Returns:
        ClientOptions object with the specified params.