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

[ISSUE-328] gets last message when LatestMessageID and inclusive #329

Merged
merged 4 commits into from
Aug 24, 2020

Conversation

quintans
Copy link
Contributor

@quintans quintans commented Jul 22, 2020

Signed-off-by: Paulo Pereira paulo.quintans@gmail.com

Fixes #328

Motivation

I have a service that when it restarts, it needs to know what was the last message successfully sent to pulsar.
A reader seems the logical place, since we can specify StartMessageID as LatestMessageID() and StartMessageIDInclusive

Modifications

When the reader is created, verify if it startMessageIDInclusive true and startMessageID == lastestMessageID() and then get the last message id and seek to that message id.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • integration tests to verify that a reader has the last message, when specifying StartMessageIDInclusive and LastestMessageID

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API: no
  • The schema: no
  • The default values of configurations: no
  • The wire protocol: no

Documentation

  • Does this pull request introduce a new feature? no

@quintans quintans changed the title [ISSUE-328][reader] gets last message when LatestMessageID and inclusive [ISSUE-328] gets last message when LatestMessageID and inclusive Jul 22, 2020
Paulo Pereira added 4 commits July 23, 2020 17:23
Signed-off-by: Paulo Pereira <paulo.pereira@karhoo.com>
…usive

Signed-off-by: Paulo Pereira <paulo.pereira@karhoo.com>
Signed-off-by: Paulo Pereira <paulo.pereira@karhoo.com>
Signed-off-by: Paulo Pereira <paulo.pereira@karhoo.com>
@quintans quintans force-pushed the last-message-inclusive branch from d64fffc to 5ee5bb2 Compare July 23, 2020 16:27
@wolfstudy wolfstudy added this to the 0.2.0 milestone Aug 24, 2020
Copy link
Member

@wolfstudy wolfstudy left a comment

Choose a reason for hiding this comment

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

LGTM +1

@wolfstudy wolfstudy merged commit a7e7239 into apache:master Aug 24, 2020
rueian added a commit to rueian/pulsar-client-go that referenced this pull request Feb 15, 2021
Fixes apache#356
Fixes apache#419

Motivtions

The changes made by the original PR apache#329 are no longer works.
This PR is trying to fix the bugs and make the test case be more robust.

Moditications

* fix the wrong `pc.startMessageID == lastestMessageID` with `pc.startMessageID.equal(lastestMessageID.(messageID))`
* fix the hanging `pc.requestSeek(msgID.messageID)` with `pc.requestSeekWithoutClear(msgID.messageID)` before the dispatch loop
* make `HasNext()` return true in case of `StartMessageIdInclusive` and `LastestMessageID`
* make `TestReaderLatestInclusiveHasNext` test case be more robust
rueian added a commit to rueian/pulsar-client-go that referenced this pull request Feb 16, 2021
Fixes apache#356
Fixes apache#419

Motivtions

The changes made by the original PR apache#329 are no longer works.
This PR is trying to fix the bugs and make the test case be more robust.

Moditications

* fix the wrong `pc.startMessageID == lastestMessageID` with `pc.startMessageID.equal(lastestMessageID.(messageID))`
* fix the hanging `pc.requestSeek(msgID.messageID)` with `pc.requestSeekWithoutClear(msgID.messageID)` before the dispatch loop
* make `TestReaderLatestInclusiveHasNext` test case be more robust
rueian added a commit to rueian/pulsar-client-go that referenced this pull request Feb 16, 2021
Fixes apache#356
Fixes apache#419

Motivtions

The changes made by the original PR apache#329 are no longer works.
This PR is trying to fix the bugs and make the test case be more robust.

Moditications

* fix the wrong `pc.startMessageID == lastestMessageID` with `pc.startMessageID.equal(lastestMessageID.(messageID))`
* fix the hanging `pc.requestSeek(msgID.messageID)` with `pc.requestSeekWithoutClear(msgID.messageID)` before the dispatch loop
* make the `HasNext()` return true in case of `StartMessageIdInclusive` and `LastestMessageID`
* make the `TestReaderLatestInclusiveHasNext` test case be more robust
rueian added a commit to rueian/pulsar-client-go that referenced this pull request Feb 16, 2021
Fixes apache#356
Fixes apache#419

Motivtions

The changes made by the original PR apache#329 are no longer works.
This PR is trying to fix the bugs and make the test case be more robust.

Moditications

* fix the wrong `pc.startMessageID == lastestMessageID` with `pc.startMessageID.equal(lastestMessageID.(messageID))`
* fix the hanging `pc.requestSeek(msgID.messageID)` with `pc.requestSeekWithoutClear(msgID.messageID)` before the dispatch loop
* make the `TestReaderLatestInclusiveHasNext` test case be more robust
rueian added a commit to rueian/pulsar-client-go that referenced this pull request Feb 16, 2021
Fixes apache#356
Fixes apache#419

Motivtions

The changes made by the original PR apache#329 are no longer works.
This PR is trying to fix the bugs and make the test case be more robust.

Moditications

* fix the wrong comparison `pc.startMessageID == lastestMessageID` with `pc.startMessageID.equal(lastestMessageID.(messageID))`
* fix the hanging `pc.requestSeek(msgID.messageID)` with `pc.requestSeekWithoutClear(msgID.messageID)` before the dispatch loop
* make the `TestReaderLatestInclusiveHasNext` test case be more robust
wolfstudy pushed a commit that referenced this pull request Feb 19, 2021
* Fix reader with start latest message id inclusive (#329)

Fixes #356
Fixes #419

Motivtions

The changes made by the original PR #329 are no longer works.
This PR is trying to fix the bugs and make the test case be more robust.

Moditications

* fix the wrong comparison `pc.startMessageID == lastestMessageID` with `pc.startMessageID.equal(lastestMessageID.(messageID))`
* fix the hanging `pc.requestSeek(msgID.messageID)` with `pc.requestSeekWithoutClear(msgID.messageID)` before the dispatch loop
* make the `TestReaderLatestInclusiveHasNext` test case be more robust

* Renew the expired certs in integration-tests with script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HasNext returns false when reading last message inclusive
2 participants