Annotation Interface PartitionOffset
Used to add partition/initial offset information to a
KafkaListener
.- Author:
- Artem Bilan, Gary Russell
-
Required Element Summary
Modifier and TypeRequired ElementDescriptionThe initial offset of thepartition()
.The partition within the topic to listen on. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionBy default, positiveinitialOffset()
is absolute, negative is relative to the current topic end.
-
Element Details
-
partition
String partitionThe 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 encompassingTopicPartition
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 initialOffsetThe initial offset of thepartition()
. 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 relativeToCurrentBy default, positiveinitialOffset()
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"
-