public class KafkaIngressStartupPosition
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
KafkaIngressStartupPosition.DatePosition |
static class |
KafkaIngressStartupPosition.EarliestPosition |
static class |
KafkaIngressStartupPosition.GroupOffsetsPosition |
static class |
KafkaIngressStartupPosition.LatestPosition |
static class |
KafkaIngressStartupPosition.SpecificOffsetsPosition |
Modifier and Type | Method and Description |
---|---|
KafkaIngressStartupPosition.DatePosition |
asDate()
Returns this position as a
KafkaIngressStartupPosition.DatePosition . |
KafkaIngressStartupPosition.SpecificOffsetsPosition |
asSpecificOffsets()
Returns this position as a
KafkaIngressStartupPosition.SpecificOffsetsPosition . |
static KafkaIngressStartupPosition |
fromDate(java.time.ZonedDateTime date)
Start consuming from offsets with ingestion timestamps after or equal to a specified
ZonedDateTime . |
static KafkaIngressStartupPosition |
fromEarliest()
Start consuming from the earliest offset possible.
|
static KafkaIngressStartupPosition |
fromGroupOffsets()
Start consuming from committed consumer group offsets in Kafka.
|
static KafkaIngressStartupPosition |
fromLatest()
Start consuming from the latest offset, i.e.
|
static KafkaIngressStartupPosition |
fromSpecificOffsets(java.util.Map<KafkaTopicPartition,java.lang.Long> specificOffsets)
Start consuming from a specified set of offsets.
|
boolean |
isDate()
Checks whether this position is configured using a date.
|
boolean |
isEarliest()
Checks whether this position is configured using the earliest offset.
|
boolean |
isGroupOffsets()
Checks whether this position is configured using committed consumer group offsets in Kafka.
|
boolean |
isLatest()
Checks whether this position is configured using the latest offset.
|
boolean |
isSpecificOffsets()
Checks whether this position is configured using specific offsets.
|
public static KafkaIngressStartupPosition fromGroupOffsets()
Note that a consumer group id must be provided for this startup mode. Please see KafkaIngressBuilder.withConsumerGroupId(String)
.
public static KafkaIngressStartupPosition fromEarliest()
public static KafkaIngressStartupPosition fromLatest()
public static KafkaIngressStartupPosition fromSpecificOffsets(java.util.Map<KafkaTopicPartition,java.lang.Long> specificOffsets)
If a specified offset does not exist for a partition, the position for that partition will
fallback to the reset position configured via KafkaIngressBuilder.withAutoResetPosition(KafkaIngressAutoResetPosition)
.
specificOffsets
- map of specific set of offsets.public static KafkaIngressStartupPosition fromDate(java.time.ZonedDateTime date)
ZonedDateTime
.
If a Kafka partition does not have any records with ingestion timestamps after or equal to
the specified date, the position for that partition will fallback to the reset position
configured via KafkaIngressBuilder.withAutoResetPosition(KafkaIngressAutoResetPosition)
.
public boolean isGroupOffsets()
public boolean isEarliest()
public boolean isLatest()
public boolean isSpecificOffsets()
public boolean isDate()
public KafkaIngressStartupPosition.SpecificOffsetsPosition asSpecificOffsets()
KafkaIngressStartupPosition.SpecificOffsetsPosition
.public KafkaIngressStartupPosition.DatePosition asDate()
KafkaIngressStartupPosition.DatePosition
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.