Enum Class BackPressureMode

java.lang.Object
java.lang.Enum<BackPressureMode>
io.awspring.cloud.sqs.listener.BackPressureMode
All Implemented Interfaces:
Serializable, Comparable<BackPressureMode>, Constable

public enum BackPressureMode extends Enum<BackPressureMode>
Configuration for application throughput.
Since:
3.0
Author:
Tomaz Fernandes
  • Enum Constant Details

    • AUTO

      public static final BackPressureMode 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

      public static final BackPressureMode 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

      public static final BackPressureMode 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

      public static BackPressureMode[] 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

      public static BackPressureMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null