Enum Class BackPressureMode
- All Implemented Interfaces:
Serializable
,Comparable<BackPressureMode>
,Constable
- Since:
- 3.0
- Author:
- Tomaz Fernandes
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionEnable automatic throughput switching and disable partial batch polling.Enable automatic throughput switching and partial batch polling.Set fixed high throughput mode. -
Method Summary
Modifier and TypeMethodDescriptionstatic BackPressureMode
Returns the enum constant of this class with the specified name.static BackPressureMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
Enable automatic throughput switching and partial batch polling.Starts in a LOW throughput mode where only one poll is made at a time. When a message is received, switches to HIGH throughput mode. If a poll returns empty and there are no inflight messages, switches back to LOW throughput mode, and so forth.
If the current number of inflight messages is close to
ContainerOptions.getMaxConcurrentMessages()
, the framework will try to acquire a partial batch with the remaining value.This is the default setting and should be balanced for most applications.
-
ALWAYS_POLL_MAX_MESSAGES
Enable automatic throughput switching and disable partial batch polling.If the current number of inflight messages is close to
ContainerOptions.getMaxConcurrentMessages()
, the framework will wait until a full batch can be polled.Useful for scenarios where the cost of retrieving less messages in a poll, and consequentially making more polls, is higher than the cost of waiting for more messages to be processed.
-
FIXED_HIGH_THROUGHPUT
Set fixed high throughput mode. In this mode up to (maxConcurrentMessages / messagesPerPoll) simultaneous polls will be made until maxConcurrentMessages is achieved.Useful for really high-throughput scenarios where the occasional automatic switch to a lower throughput would be costly.
-
-
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
-