Skip to content

[Bug] startMessageInclusive does not work for reader with chunk messages #461

Closed

Description

@BewareMyPower

Search before asking

  • I searched in the issues and found nothing similar.

Version

main branch (e264cf7)

Minimal reproduce step

Add the following test to tests/ReaderTest.cc:

TEST_F(ReaderSeekTest, testSeekInclusiveChunkMessage) {
    const auto topic = "test-seek-inclusive-chunk-message-" + std::to_string(time(nullptr));

    Producer producer;
    ProducerConfiguration producerConf;
    producerConf.setBatchingEnabled(false);
    producerConf.setChunkingEnabled(true);
    ASSERT_EQ(ResultOk, client.createProducer(topic, producerConf, producer));

    std::string largeValue(1024 * 1024 * 6, 'a');
    MessageId msgId;
    ASSERT_EQ(ResultOk, producer.send(MessageBuilder().setContent(largeValue).build(), msgId));
    ASSERT_EQ(ResultOk, producer.send(MessageBuilder().setContent(largeValue).build()));

    Reader reader;
    ReaderConfiguration readerConf;
    readerConf.setStartMessageIdInclusive(true);
    ASSERT_EQ(ResultOk, client.createReader(topic, msgId, readerConf, reader));

    Message msg;
    ASSERT_EQ(ResultOk, reader.readNext(msg, 3000));
    ASSERT_EQ(msgId, msg.getMessageId());
}

and run this test

What did you expect to see?

The test succeeds.

What did you see instead?

The test failed

pulsar-client-cpp/tests/ReaderTest.cc:912: Failure
Expected equality of these values:
  msgId
    Which is: (24,0,-1,-1);(24,1,-1,-1)
  msg.getMessageId()
    Which is: (24,2,-1,-1);(24,3,-1,-1)

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions