-
public final class BackoffHandler
This class is always coupled with a Subscription. Each subscription has exactly one BackoffHandler instance. This handler takes care of the throttling of slow subscription consumers. It does this by activating periods without sending at all and periods with low traffic. The length of this low traffic periods is configurable and flexible. It is increased/decreased at exponential scale.
The public API of this class only exposes configuration options. You can adjust the delay options.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
BackoffHandler.Companion
-
Method Summary
Modifier and Type Method Description final Duration
getInitDelay()
The initial length of a low traffic period after the first failed received packet. final Unit
setInitDelay(Duration initDelay)
The initial length of a low traffic period after the first failed received packet. final Duration
getMaxDelay()
The maximum delay until the full traffic volume is tried again. final Unit
setMaxDelay(Duration maxDelay)
The maximum delay until the full traffic volume is tried again. final Boolean
getAutoFinish()
Whether or not messages processed in this BackoffHandler should be automatically finished after receiving them without an exception. final Unit
setAutoFinish(Boolean autoFinish)
Whether or not messages processed in this BackoffHandler should be automatically finished after receiving them without an exception. -
-
Method Detail
-
getInitDelay
final Duration getInitDelay()
The initial length of a low traffic period after the first failed received packet.
-
setInitDelay
final Unit setInitDelay(Duration initDelay)
The initial length of a low traffic period after the first failed received packet.
-
getMaxDelay
final Duration getMaxDelay()
The maximum delay until the full traffic volume is tried again.
-
setMaxDelay
final Unit setMaxDelay(Duration maxDelay)
The maximum delay until the full traffic volume is tried again.
-
getAutoFinish
final Boolean getAutoFinish()
Whether or not messages processed in this BackoffHandler should be automatically finished after receiving them without an exception.
-
setAutoFinish
final Unit setAutoFinish(Boolean autoFinish)
Whether or not messages processed in this BackoffHandler should be automatically finished after receiving them without an exception.
-
-
-
-