corda / net.corda.client.rpc / CordaRPCClientConfiguration

CordaRPCClientConfiguration

open class CordaRPCClientConfiguration

Can be used to configure the RPC client connection.

Constructors

<init>

CordaRPCClientConfiguration(connectionMaxRetryInterval: Duration = 3.minutes, minimumServerProtocolVersion: Int = PLATFORM_VERSION, trackRpcCallSites: Boolean = java.lang.Boolean.getBoolean("net.corda.client.rpc.trackRpcCallSites"), reapInterval: Duration = 1.seconds, observationExecutorPoolSize: Int = 4, connectionRetryInterval: Duration = 5.seconds, connectionRetryIntervalMultiplier: Double = 1.5, maxReconnectAttempts: Int = unlimitedReconnectAttempts, maxFileSize: Int = 10485760, deduplicationCacheExpiry: Duration = 1.days)

Can be used to configure the RPC client connection.

Properties

connectionMaxRetryInterval

open val connectionMaxRetryInterval: Duration

The maximum retry interval for re-connections. The client will retry connections if the host is lost with ever increasing spacing until the max is reached. The default is 3 minutes.

connectionRetryInterval

open val connectionRetryInterval: Duration

The base retry interval for reconnection attempts. The default is 5 seconds.

connectionRetryIntervalMultiplier

open val connectionRetryIntervalMultiplier: Double

The retry interval multiplier for exponential backoff. The default is 1.5

deduplicationCacheExpiry

open val deduplicationCacheExpiry: Duration

The cache expiry of a deduplication watermark per client. Default is 1 day.

maxFileSize

open val maxFileSize: Int

Maximum size of RPC responses, in bytes. Default is 10mb.

maxReconnectAttempts

open val maxReconnectAttempts: Int

Maximum reconnect attempts on failover or disconnection. The default is -1 which means unlimited.

minimumServerProtocolVersion

open val minimumServerProtocolVersion: Int

The minimum protocol version required from the server. This is equivalent to the node's platform version number. If this minimum version is not met, an exception will be thrown at startup. If you use features introduced in a later version, you can bump this to match the platform version you need and get an early check that runs before you do anything.

observationExecutorPoolSize

open val observationExecutorPoolSize: Int

The number of threads to use for observations for executing Observable.onNext. This only has any effect if observableExecutor is null (which is the default). The default is 4.

reapInterval

open val reapInterval: Duration

The interval of unused observable reaping. Leaked Observables (unused ones) are detected using weak references and are cleaned up in batches in this interval. If set too large it will waste server side resources for this duration. If set too low it wastes client side cycles. The default is to check once per second.

trackRpcCallSites

open val trackRpcCallSites: Boolean

If set to true the client will track RPC call sites (default is false). If an error occurs subsequently during the RPC or in a returned Observable stream the stack trace of the originating RPC will be shown as well. Note that constructing call stacks is a moderately expensive operation.

Functions

component1

operator fun component1(): Duration

equals

open fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Companion Object Properties

DEFAULT

val DEFAULT: CordaRPCClientConfiguration

Provides an instance of this class with the parameters set to our recommended defaults.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.