-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Pulsar reader doesn't return correct last message with startMessageIdInclusive() #9330
Comments
@maimom1924 Looks like this issue already addressed by this PR #6362. You can try with 2.5.1 or higher version to test it. |
@maimom1924 @zymap I will close this issue first, feel free to reopen it if needed. |
Thank you so much for your help and support. I tried to test with version
2.5.1 but when there is no message on the topic and I call the
reader.hasMessageAvailable(), I got true value. Could you please help
check on this?
Reader<byte[]> reader = pulsarClient.newReader()
.topic(config.getStateTopic())
.startMessageId(MessageId.latest)
.startMessageIdInclusive()
.create();
boolean hasMessage = reader.hasMessageAvailable();
|
@maimom1924 I think it's the right behavior because you specified the |
so even though there is no message, that should return true, right?
…On Mon, Feb 1, 2021, 10:09 AM Yong Zhang ***@***.***> wrote:
@maimom1924 <https://github.com/maimom1924> I think it's the right
behavior because you specified the startMessageIdInclusive which means
you can read out the last message.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9330 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASTNJLPKDQB4ZMVGVBZLO4LS4X5M5ANCNFSM4WT4NA2A>
.
|
Yes. After reading the last message, then the |
@zymap I mean that the topic is completely empty, so the |
How do you use this in python? I see no provision at all for startMessageIdInclusive . |
I want to read last message from topic "A" by using Pulsar Reader as shown in below code:
Before executing the above code, I have produced many messages on that topic and as the result:
msg
that I get here is not the last message butthe last message - 1
when I add.startMessageIdInclusive()
.startMessageIdInclusive()
,reader.hasMessageAvailable()
will return false.Pulsar version that I used:
The text was updated successfully, but these errors were encountered: