Class LocalEventBus.Builder
java.lang.Object
dk.cloudcreate.essentials.reactive.LocalEventBus.Builder
- Enclosing class:
- LocalEventBus
Builder class for
LocalEventBus.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackpressureBufferSize(int backpressureBufferSize) Set the backpressure size forSinks.Many's onBackpressureBuffer size.build()Build theLocalEventBusfrom the properties setSet the name of the bus.onErrorHandler(OnErrorHandler onErrorHandler) Set the error handler which will be called if any asynchronous subscriber/consumer fails to handle an event.overflowMaxRetries(int maxRetries) Set the maximum number of retries for events that overflow the Flux.parallelThreads(int parallelThreads) Set the number of parallel asynchronous processing threads.queuedTaskCapFactor(double queuedTaskCapFactor) Set the factor to calculate queued task capacity from the backpressureBufferSize.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
busName
Set the name of the bus. Default value is "default"- Parameters:
busName- the name of the bus- Returns:
- this builder instance
-
parallelThreads
Set the number of parallel asynchronous processing threads. Default value is the number of available processors- Parameters:
parallelThreads- the number of parallel asynchronous processing threads- Returns:
- this builder instance
-
backpressureBufferSize
Set the backpressure size forSinks.Many's onBackpressureBuffer size. Default value is 1024.- Parameters:
backpressureBufferSize- the backpressure size forSinks.Many's onBackpressureBuffer size- Returns:
- this builder instance
-
overflowMaxRetries
Set the maximum number of retries for events that overflow the Flux. Default value is 20.- Parameters:
maxRetries- the maximum number of retries for events that overflow the Flux- Returns:
- this builder instance
-
queuedTaskCapFactor
Set the factor to calculate queued task capacity from the backpressureBufferSize. Default value is 1.5.- Parameters:
queuedTaskCapFactor- the factor to calculate queued task capacity from the backpressureBufferSize- Returns:
- this builder
-
onErrorHandler
Set the error handler which will be called if any asynchronous subscriber/consumer fails to handle an event. Default logs an error with the failure details- Parameters:
onErrorHandler- the error handler which will be called if any asynchronous subscriber/consumer fails to handle an event- Returns:
- this builder instance
-
build
Build theLocalEventBusfrom the properties set- Returns:
- the
LocalEventBus
-