public class MessageIdStartCursor extends Object implements StartCursor
Constructor and Description |
---|
MessageIdStartCursor(org.apache.pulsar.client.api.MessageId messageId,
boolean inclusive)
The default
inclusive behavior should be controlled in ConsumerBuilder.startMessageIdInclusive() . |
Modifier and Type | Method and Description |
---|---|
CursorPosition |
position(String topic,
int partitionId) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
defaultStartCursor, earliest, fromMessageId, fromMessageId, fromMessageTime, fromPublishTime, latest
public MessageIdStartCursor(org.apache.pulsar.client.api.MessageId messageId, boolean inclusive)
inclusive
behavior should be controlled in ConsumerBuilder.startMessageIdInclusive()
. But pulsar has a bug and don't support this
currently. We have to use entry + 1
policy for consuming the next available message.
If the message id entry is not valid. Pulsar would automatically find next valid message id.
Please referer this
code for understanding pulsar internal logic.messageId
- The message id for start position.inclusive
- Whether we include the start message id in consuming result. This works only
if we provide a specified message id instead of MessageId.earliest
or MessageId.latest
.public CursorPosition position(String topic, int partitionId)
position
in interface StartCursor
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.