Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in seek if no messages in topic #1277

Closed
wants to merge 1 commit into from

Conversation

jerrypeng
Copy link
Contributor

If you call getLastMessageId and then use that messageId to seek, the seek will throw an exception since the ledgerId will exist but the entryId will be -1

@@ -1259,6 +1259,9 @@ public void seek(MessageId messageId) throws PulsarClientException {

long requestId = client.newRequestId();
MessageIdImpl msgId = (MessageIdImpl) messageId;
if (msgId.getEntryId() == -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not be necessary correct. (ledgerId=5, entryId=-1) is a valid position to seek and it should not got to "earliest"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha I will close this PR then

@jerrypeng jerrypeng closed this Feb 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants