You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/03/11 11:56:34 UTC

[GitHub] [pulsar] terrencehan opened a new issue #6523: Consume the last N messages from Pulsar

terrencehan opened a new issue #6523: Consume the last N messages from Pulsar
URL: https://github.com/apache/pulsar/issues/6523
 
 
   In our product, we need to show the last N messages to users. While using Kafka, we could simply pull messages based on Offset.  Is there an equivalent of method or API for Pulsar?
   
   It seems we could only subscribe to a topic and try to move the cursor to some point based on messageId. But it hard to determine which messageId should be used, because messageId is not sequential.   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] codelipenghui commented on issue #6523: Consume the last N messages from Pulsar

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #6523: Consume the last N messages from Pulsar
URL: https://github.com/apache/pulsar/issues/6523#issuecomment-599338845
 
 
   Yes, currently only support reset cursor by time or message ID. Maybe it needs to support reset cursor by messages count(e.g. last 100 messages) in Pulsar and since a message can be a batch message. If we want to reset to precise last 100 messages, This can be an expensive operation since the broker needs to get the message metadata and counting the number of messages. 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] jiazhai commented on issue #6523: Consume the last N messages from Pulsar

Posted by GitBox <gi...@apache.org>.
jiazhai commented on issue #6523: Consume the last N messages from Pulsar
URL: https://github.com/apache/pulsar/issues/6523#issuecomment-599585077
 
 
   @terrencehan Regarding MessageId, It could get from the produce.send or consumer.receive.  Maybe reader api is more suitable for this case. 1), set reader init MessageId, 2) read N messages.  the initial messageId maybe similar to the way how you get kafka Offset.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services