Client client(serviceUrl);
const std::string topic = "test-seek-latest-message-id-" + std::to_string(time(nullptr));
Producer producer;
ASSERT_EQ(ResultOk, client.createProducer(topic, producer));
MessageId id;
ASSERT_EQ(ResultOk, producer.send(MessageBuilder().setContent("msg").build(), id));
Reader readerExclusive;
ASSERT_EQ(ResultOk,
client.createReader(topic, MessageId::latest(), ReaderConfiguration(), readerExclusive));
Reader readerInclusive;
ASSERT_EQ(ResultOk,
client.createReader(topic, MessageId::latest(),
ReaderConfiguration().setStartMessageIdInclusive(true), readerInclusive));
Message msg;
bool hasMsgAvaliable = false;
readerInclusive.hasMessageAvailable(hasMsgAvaliable);
ASSERT_TRUE(hasMsgAvaliable);
ASSERT_EQ(ResultOk, readerInclusive.readNext(msg, 3000));
ASSERT_EQ(ResultTimeout, readerExclusive.readNext(msg, 3000));
readerExclusive.close();
readerInclusive.close();
producer.close();
The test should be passed.
The readerInclusive should be able to read the next message.
The readerInclusive can't read the next message.
Search before asking
Version
9ffd2ef
Minimal reproduce step
What did you expect to see?
The test should be passed.
The readerInclusive should be able to read the next message.
What did you see instead?
The readerInclusive can't read the next message.
Anything else?
No response
Are you willing to submit a PR?