Enum OnOverflow.Strategy
- java.lang.Object
-
- java.lang.Enum<OnOverflow.Strategy>
-
- org.eclipse.microprofile.reactive.messaging.OnOverflow.Strategy
-
- All Implemented Interfaces:
Serializable,Comparable<OnOverflow.Strategy>
- Enclosing class:
- OnOverflow
public static enum OnOverflow.Strategy extends Enum<OnOverflow.Strategy>
The back pressure strategy.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BUFFERBuffers all values until the downstream consumes it.DROPDrops the most recent value if the downstream can't keep up.FAILSends an error signal to the downstream subscriber in the case where it can't keep up.LATESTKeeps only the latest value, dropping any previous value if the downstream can't keep up.NONEThe values are propagated without any back pressure strategy.THROW_EXCEPTIONCauses anIllegalStateExceptionto be thrown by theEmitter.sendmethod if the downstream can't keep up.UNBOUNDED_BUFFERBuffers all values until the downstream consumes it.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OnOverflow.StrategyvalueOf(String name)Returns the enum constant of this type with the specified name.static OnOverflow.Strategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BUFFER
public static final OnOverflow.Strategy 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
IllegalStateExceptionwill be thrown by theEmitter.sendmethod.
-
UNBOUNDED_BUFFER
public static final OnOverflow.Strategy 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
public static final OnOverflow.Strategy THROW_EXCEPTION
Causes anIllegalStateExceptionto be thrown by theEmitter.sendmethod if the downstream can't keep up.
-
DROP
public static final OnOverflow.Strategy 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
public static final OnOverflow.Strategy 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
public static final OnOverflow.Strategy LATEST
Keeps only the latest value, dropping any previous value if the downstream can't keep up.
-
NONE
public static final OnOverflow.Strategy 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 Detail
-
values
public static OnOverflow.Strategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (OnOverflow.Strategy c : OnOverflow.Strategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static OnOverflow.Strategy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
-