Annotation Interface PartitionOffset


@Target({}) @Retention(RUNTIME) public @interface PartitionOffset
Used to add partition/initial offset information to a KafkaListener.
Author:
Artem Bilan, Gary Russell, Wang Zhiyang
  • 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"
    • seekPosition

      String seekPosition
      Position to seek on partition assignment. By default, seek by offset. Set TopicPartitionOffset.SeekPosition seek position enum name to specify "special" seeks, no restrictions on capitalization. If seekPosition set 'BEGINNING' or 'END', ignore relativeToCurrent and initialOffset. If seekPosition set 'TIMESTAMP', initialOffset means time stamp, ignore relativeToCurrent.
      Returns:
      special seeks.
      Since:
      3.2
      See Also:
      Default:
      ""