Class CoreEnvironment.Builder<SELF extends CoreEnvironment.Builder<SELF>>
- Enclosing class:
- CoreEnvironment
public static class CoreEnvironment.Builder<SELF extends CoreEnvironment.Builder<SELF>> extends Object
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder() -
Method Summary
Modifier and Type Method Description AggregatingMeterConfig.BuilderaggregatingMeterConfig()SELFaggregatingMeterConfig(AggregatingMeterConfig.Builder aggregatingMeterConfig)CoreEnvironmentbuild()Turns this builder into a realCoreEnvironment.CompressionConfig.BuildercompressionConfig()Returns the currently stored config builder.SELFcompressionConfig(CompressionConfig.Builder compressionConfig)Allows to customize document value compression settings.SELFeventBus(EventBus eventBus)Customizes the event bus for the SDK.IoConfig.BuilderioConfig()Returns the currently stored config builder.SELFioConfig(IoConfig.Builder ioConfig)Allows to customize various I/O-related configuration properties.SELFioEnvironment(IoEnvironment.Builder ioEnvironment)Allows to customize I/O thread pools.SELFload(PropertyLoader<CoreEnvironment.Builder> loader)Immediately loads the properties from the given loader into the environment.LoggerConfig.BuilderloggerConfig()Returns the currently stored config builder.SELFloggerConfig(LoggerConfig.Builder loggerConfig)Allows to provide a custom configuration for the default logger used.SELFmaxNumRequestsInRetry(long maxNumRequestsInRetry)Allows to customize the maximum number of requests allowed in the retry timer.SELFmeter(Meter meter)Allows to configure a custom metrics implementation.OrphanReporterConfig.BuilderorphanReporterConfig()Returns the currently stored config builder.SELForphanReporterConfig(OrphanReporterConfig.Builder orphanReporterConfig)Allows to customize the behavior of the orphan response reporter.SELFrequestTracer(RequestTracer requestTracer)Allows to configure a custom tracer implementation.SELFretryStrategy(RetryStrategy retryStrategy)Allows to customize the default retry strategy.SELFscheduler(Scheduler scheduler)Customizes the default Reactor scheduler used for parallel operations.SecurityConfig.BuildersecurityConfig()Returns the currently stored config builder.SELFsecurityConfig(SecurityConfig.Builder securityConfig)Allows to configure everything related to TLS/encrypted connections.protected SELFself()ThresholdRequestTracerConfig.BuilderthresholdRequestTracerConfig()SELFthresholdRequestTracerConfig(ThresholdRequestTracerConfig.Builder thresholdRequestTracerConfig)Allows to customize the threshold request tracer configuration.TimeoutConfig.BuildertimeoutConfig()Returns the currently stored config builder.SELFtimeoutConfig(TimeoutConfig.Builder timeoutConfig)Allows to customize the default timeouts for all operations.
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
self
-
maxNumRequestsInRetry
Allows to customize the maximum number of requests allowed in the retry timer.If the
CoreEnvironment.DEFAULT_MAX_NUM_REQUESTS_IN_RETRYis reached, each request that would be queued for retry is instead cancelled with aCancellationReason.TOO_MANY_REQUESTS_IN_RETRY. This acts as a form of safety net and backpressure.- Parameters:
maxNumRequestsInRetry- the maximum number of requests outstanding for retry.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
load
Immediately loads the properties from the given loader into the environment.- Parameters:
loader- the loader to load the properties from.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
ioEnvironment
Allows to customize I/O thread pools.Note that the
IoEnvironmentholds thread pools and other resources. If you do not want to customize thread pool sizes, you likely want to look at theIoConfiginstead.- Parameters:
ioEnvironment- the IO environment to customize.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
ioConfig
Allows to customize various I/O-related configuration properties.The I/O config is the main way to control how the SDK behaves at the lower levels. It allows to customize properties such as tcp keepalive, number of connections, circuit breakers, etc.
- Parameters:
ioConfig- the custom I/O config to use.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
ioConfig
Returns the currently stored config builder.- Returns:
- the current builder.
-
orphanReporterConfig
Allows to customize the behavior of the orphan response reporter.The orphan reporter logs all responses that arrived when the requesting side is not listening anymore (usually because of a timeout). The config can be modified to tune certain properties like the sample size or the emit interval.
- Parameters:
orphanReporterConfig- the custom orphan reporter config.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
orphanReporterConfig
Returns the currently stored config builder.- Returns:
- the current builder.
-
aggregatingMeterConfig
-
aggregatingMeterConfig
-
thresholdRequestTracerConfig
public SELF thresholdRequestTracerConfig(ThresholdRequestTracerConfig.Builder thresholdRequestTracerConfig)Allows to customize the threshold request tracer configuration.- Parameters:
thresholdRequestTracerConfig- the configuration which should be used.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
thresholdRequestTracerConfig
-
compressionConfig
Allows to customize document value compression settings.Usually this does not need to be tuned, but thresholds can be modified or compression can be disabled completely if needed.
- Parameters:
compressionConfig- the custom compression config.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
compressionConfig
Returns the currently stored config builder.- Returns:
- the current builder.
-
securityConfig
Allows to configure everything related to TLS/encrypted connections.Note that if you are looking to use client certificate authentication, please refer to the
CertificateAuthenticatorinstead.- Parameters:
securityConfig- the custom security config to use.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
securityConfig
Returns the currently stored config builder.- Returns:
- the current builder.
-
timeoutConfig
Allows to customize the default timeouts for all operations.Each timeout can also be modified on a per-request basis in their respective options blocks.
- Parameters:
timeoutConfig- the custom timeout config to use.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
timeoutConfig
Returns the currently stored config builder.- Returns:
- the current builder.
-
loggerConfig
Allows to provide a custom configuration for the default logger used.The default logger attaches itself to the
EventBuson the environment and logs consumed events. This configuration allows to customize its behavior, diagnostic context etc.- Parameters:
loggerConfig- the custom logger config to use.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
loggerConfig
Returns the currently stored config builder.- Returns:
- the current builder.
-
eventBus
Customizes the event bus for the SDK.The SDK ships with a high-performance implementation of a event bus. Only swap out if you have special needs, usually what you want instead is to register your own consumer on the event bus instead (
EventBus.subscribe(Consumer))!- Parameters:
eventBus- the event bus to use.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
scheduler
Customizes the default Reactor scheduler used for parallel operations.Usually you do not need to modify the scheduler, use with care.
- Parameters:
scheduler- a custom scheduler to use.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
retryStrategy
Allows to customize the default retry strategy.Note that this setting modifies the SDK-wide retry strategy. It can still be overridden on a per-request basis in the respective options block.
- Parameters:
retryStrategy- the default retry strategy to use for all operations.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
requestTracer
Allows to configure a custom tracer implementation.IMPORTANT: this is a volatile, likely to change API!
- Parameters:
requestTracer- the custom request tracer to use.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
meter
Allows to configure a custom metrics implementation.IMPORTANT: this is a volatile, likely to change API!
- Parameters:
meter- the custom metrics implementation to use.- Returns:
- this
CoreEnvironment.Builderfor chaining purposes.
-
build
Turns this builder into a realCoreEnvironment.- Returns:
- the created core environment.
-