Skip to content

[Bug] Inclusive start message Id not work when reader reads from latest msg id #385

Closed

Description

@RobertIndie

Search before asking

  • I searched in the issues and found nothing similar.

Version

9ffd2ef

Minimal reproduce step

    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();

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?

  • I'm willing to submit a PR!

Activity

  1. self-assigned this
    on Jan 12, 2024
  2. added a commit that references this issue on Jan 15, 2024
    a1cf401
  3. added this to the 3.5.0 milestone on Jan 15, 2024
  4. Samreay commented on Mar 8, 2024

    @Samreay

    Hey @RobertIndie, any chance we can get a release of the C++ client with this fix in it soon? It's been a couple of months now and I'm conscious that the C++ needs to be released, then the python client updated, and then released, before I can use this fix.

  5. BewareMyPower commented on Mar 12, 2024

    @BewareMyPower
    Contributor

    @Samreay I started the 2nd vote for the C++ client 3.5.0: https://lists.apache.org/thread/x9r3bcpmbnownd0twowpqwbqodgg7r8w

    It has been delayed since I want to include the fix (#409) on another issue reported in the python client (apache/pulsar-client-python#199).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions