pulsar-client-cpp
pulsar-client-cpp copied to clipboard
[Bug] Immediate seek after a seek will fail with NotConnected
Search before asking
- [x] I searched in the issues and found nothing similar.
Version
master
Minimal reproduce step
TEST(ConsumerTest, testSeekAfterSeek) {
const auto topic = "test-seek-after-seek-" + std::to_string(time(nullptr));
const auto subscription = "sub";
Client client(lookupUrl);
Consumer consumer;
ASSERT_EQ(ResultOk, client.subscribe(topic, subscription, consumer));
ASSERT_EQ(ResultOk, consumer.seek(TimeUtils::currentTimeMillis()));
ASSERT_EQ(ResultOk, consumer.seek(MessageId::earliest()));
ASSERT_EQ(ResultOk, consumer.seek(TimeUtils::currentTimeMillis()));
client.close();
}
Run the test above
What did you expect to see?
All seek calls should succeed
What did you see instead?
Expected equality of these values:
ResultOk
Which is: Ok
consumer.seek(MessageId::earliest())
Which is: NotConnected
Anything else?
No response
Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!