You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "deepakks-tibco (via GitHub)" <gi...@apache.org> on 2025/02/07 12:15:32 UTC
[D] SeekBy message id is not working as expected if messages are sent in between the Execution [pulsar]
GitHub user deepakks-tibco created a discussion: SeekBy message id is not working as expected if messages are sent in between the Execution
If we provide any incorrect/future message id in the LedgerID, EntryID fields. Start the Consumer and Producer activity parallelly and send the messages from the producer in between the execution. The consumer will consume the messages even if the Seek by values are not met.
Created a standalone consumer app. Produced 30 messages . produced message id from 15:30:-1 (ledger Id:15 entry id:30) to 15:59:-1 When I use seek() with incorrect/future message id example entry id given 15:112:-1 from standalone consumer. The consumer starts consuming all messages.
Here is the standalone consumer code.
PulsarClient client=PulsarClient.builder().serviceUrl("pulsar://localhost:6650").build();
Consumer<byte[]> consumer=client.newConsumer().topic("test-topic-avro").subscriptionName("subscription").subscribe();
try {
MessageId messageId = new MessageIdImpl(15,112,0);
consumer.seek(messageId);
} catch (IOException e) {
e.printStackTrace();
}
while(true)
{
Message<byte[]> msg=consumer.receive();
System.out.println("received messages:"+new String(msg.getData()));
System.out.println("received message id:"+new String(msg.getMessageId().toString() ));
consumer.acknowledge(msg);
}
GitHub link: https://github.com/apache/pulsar/discussions/23948
----
This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@pulsar.apache.org
Re: [D] SeekBy message id is not working as expected if messages are sent in between the Execution [pulsar]
Posted by "deepakks-tibco (via GitHub)" <gi...@apache.org>.
GitHub user deepakks-tibco added a comment to the discussion: SeekBy message id is not working as expected if messages are sent in between the Execution
Hi,
Anyone have the solution for this?
GitHub link: https://github.com/apache/pulsar/discussions/23948#discussioncomment-12386544
----
This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@pulsar.apache.org