@PublicEvolving @FunctionalInterface public interface StartCursor extends Serializable
This class would be used only for SubscriptionType.Exclusive
and SubscriptionType.Failover
.
Modifier and Type | Method and Description |
---|---|
static StartCursor |
defaultStartCursor() |
static StartCursor |
earliest() |
static StartCursor |
fromMessageId(org.apache.pulsar.client.api.MessageId messageId) |
static StartCursor |
fromMessageId(org.apache.pulsar.client.api.MessageId messageId,
boolean inclusive) |
static StartCursor |
fromMessageTime(long timestamp) |
static StartCursor |
latest() |
CursorPosition |
position(String topic,
int partitionId) |
default void |
seekPosition(String topic,
int partitionId,
org.apache.pulsar.client.api.Consumer<?> consumer)
Helper method for seek the right position for given pulsar consumer.
|
CursorPosition position(String topic, int partitionId)
default void seekPosition(String topic, int partitionId, org.apache.pulsar.client.api.Consumer<?> consumer) throws org.apache.pulsar.client.api.PulsarClientException
org.apache.pulsar.client.api.PulsarClientException
static StartCursor defaultStartCursor()
static StartCursor earliest()
static StartCursor latest()
static StartCursor fromMessageId(org.apache.pulsar.client.api.MessageId messageId)
static StartCursor fromMessageId(org.apache.pulsar.client.api.MessageId messageId, boolean inclusive)
messageId
- Find the available message id and start consuming from it.inclusive
- true
would include the given message id.static StartCursor fromMessageTime(long timestamp)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.