Class AutoOffsetReset

java.lang.Object
org.apache.kafka.streams.AutoOffsetReset

public class AutoOffsetReset extends Object
Sets the auto.offset.reset configuration when adding a source processor or when creating KStream or KTable via StreamsBuilder.
  • Method Details

    • none

      public static AutoOffsetReset none()
      Creates an AutoOffsetReset instance representing "none".
      Returns:
      An AutoOffsetReset instance for no reset.
    • earliest

      public static AutoOffsetReset earliest()
      Creates an AutoOffsetReset instance representing "earliest".
      Returns:
      An AutoOffsetReset instance for the "earliest" offset.
    • latest

      public static AutoOffsetReset latest()
      Creates an AutoOffsetReset instance representing "latest".
      Returns:
      An AutoOffsetReset instance for the "latest" offset.
    • byDuration

      public static AutoOffsetReset byDuration(Duration duration)
      Creates an AutoOffsetReset instance for the specified reset duration.
      Parameters:
      duration - The duration to use for the offset reset; must be non-negative.
      Returns:
      An AutoOffsetReset instance with the specified duration.
      Throws:
      IllegalArgumentException - If the duration is negative.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object