Enum Class OnOverflow.Strategy
- All Implemented Interfaces:
Serializable
,Comparable<OnOverflow.Strategy>
,Constable
- Enclosing class:
- OnOverflow
The back pressure strategy.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionBuffers all values until the downstream consumes it.Drops the most recent value if the downstream can't keep up.Sends an error signal to the downstream subscriber in the case where it can't keep up.Keeps only the latest value, dropping any previous value if the downstream can't keep up.The values are propagated without any back pressure strategy.Causes anIllegalStateException
to be thrown by theEmitter.send
method if the downstream can't keep up.Buffers all values until the downstream consumes it. -
Method Summary
Modifier and TypeMethodDescriptionstatic OnOverflow.Strategy
Returns the enum constant of this class with the specified name.static OnOverflow.Strategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BUFFER
Buffers all values until the downstream consumes it. This creates a buffer with the size specified byOnOverflow.bufferSize()
if present. Otherwise, the size will be the value of the config property mp.messaging.emitter.default-buffer-size.If the buffer is full, an
IllegalStateException
will be thrown by theEmitter.send
method. -
UNBOUNDED_BUFFER
Buffers all values until the downstream consumes it. This creates an unbounded buffer so the application may run out of memory if values are continually added faster than they are consumed. -
THROW_EXCEPTION
Causes anIllegalStateException
to be thrown by theEmitter.send
method if the downstream can't keep up. -
DROP
Drops the most recent value if the downstream can't keep up. It means that new value emitted by the upstream are ignored. -
FAIL
Sends an error signal to the downstream subscriber in the case where it can't keep up. This terminates the reactive stream so no more values will be published. -
LATEST
Keeps only the latest value, dropping any previous value if the downstream can't keep up. -
NONE
The values are propagated without any back pressure strategy. It's the responsibility from the downstream to implement a strategy to deal with overflow.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-