Annotation Interface PartitionOffset


@Target({}) @Retention(RUNTIME) public @interface PartitionOffset
Used to add partition/initial offset information to a KafkaListener.
Author:
Artem Bilan, Gary Russell
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The initial offset of the partition().
    The partition within the topic to listen on.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    By default, positive initialOffset() is absolute, negative is relative to the current topic end.
  • Element Details

    • partition

      String partition
      The partition within the topic to listen on. Property place holders and SpEL expressions are supported, which must resolve to Integer (or String that can be parsed as Integer). '*' indicates that the initial offset will be applied to all partitions in the encompassing TopicPartition The string can contain a comma-delimited list of partitions, or ranges of partitions (e.g. 0-5, 7, 10-15), in which case, the offset will be applied to all of those partitions.
      Returns:
      partition within the topic.
    • initialOffset

      String initialOffset
      The initial offset of the partition(). Property place holders and SpEL expressions are supported, which must resolve to Long (or String that can be parsed as Long).
      Returns:
      initial offset.
    • relativeToCurrent

      String relativeToCurrent
      By default, positive initialOffset() is absolute, negative is relative to the current topic end. When this is 'true', the initial offset (positive or negative) is relative to the current consumer position.
      Returns:
      whether or not the offset is relative to the current position.
      Since:
      1.1
      Default:
      "false"