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 2021/05/05 09:17:22 UTC

[GitHub] [pulsar] tomjohn9 opened a new issue #10483: Reader does not return any message when configured with start with inclusive latest messageId

tomjohn9 opened a new issue #10483:
URL: https://github.com/apache/pulsar/issues/10483


   **Describe the bug**
   Creating reader with messageId pointing to `MessageId.latest` together with `startMessageIdInclusive`,there is no message returned when `readNext` is invoked. Newly coming messages are consumed. When using `MessageId.earliest`, a message is returned - means there are messages in that topic.
   
   Having running local docker image with puslar 2.7.1 and java client 2.7.1
   
   **Steps To Reproduce**
   
   ```
   pulsarClient.newReader(JSONSchema.of(MySchema.class))
                   .topic(topic)
                   .startMessageId(MessageId.latest)
                   .startMessageIdInclusive().create()
                   .readNext(250, TimeUnit.MILLISECONDS)
   ```
   
   **Expected behavior**
   Last message in queue is returned when calling `Reader.readNext` with Reader configuration` MessageId.latest` and `startMessageIdInclusive()`
   
   **Similar Issue**
   Seems, it was already reported in [issue 4912](https://github.com/apache/pulsar/issues/4912) in first paragraph **Test3** 
   
   > Test3:When configuring Reader with startMessageIdInclusive and positioning stream at MessageId.latest, then the next call to Reader.readNext(timeout) should have returned the last message of the topic, but it times out and returns null (without a configured timeout it blocks forever).
   .....
   Expected behavior
   test3 expected to return the last message in topic, test4 hasMessageAvailable expected to be false.
   
    but it is little bit confusing because underlying method `readMessage` starts with `hasMessageAvailable()` which in that time returns wrongly true and `readNext` is reached but no message is returned, but should be.


-- 
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



[GitHub] [pulsar] codelipenghui commented on issue #10483: Reader does not return any message when configured with reading inclusive latest messageId

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #10483:
URL: https://github.com/apache/pulsar/issues/10483#issuecomment-1067956676


   Here is the discussion thread https://lists.apache.org/thread/kwljdckm0ykstq8oodz6550hqxdltc98 for this issue.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] adrianog edited a comment on issue #10483: Reader does not return any message when configured with reading inclusive latest messageId

Posted by GitBox <gi...@apache.org>.
adrianog edited a comment on issue #10483:
URL: https://github.com/apache/pulsar/issues/10483#issuecomment-834378933


   Yes it should be fixed anyway. And please can startMessageIdInclusive be made available to c++/python as well. It is a glaring omission. #10328


-- 
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



[GitHub] [pulsar] adrianog commented on issue #10483: Reader does not return any message when configured with reading inclusive latest messageId

Posted by GitBox <gi...@apache.org>.
adrianog commented on issue #10483:
URL: https://github.com/apache/pulsar/issues/10483#issuecomment-834378933


   Yes and please can startMessageIdInclusive be made available to c++/python as well. It is a glaring omission. #10328


-- 
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



[GitHub] [pulsar] PatrykWitkowski commented on issue #10483: Reader does not return any message when configured with reading inclusive latest messageId

Posted by GitBox <gi...@apache.org>.
PatrykWitkowski commented on issue #10483:
URL: https://github.com/apache/pulsar/issues/10483#issuecomment-833293066


   If you invoke `reader.hasMessageAvailable()` before `reader.readNext()` then it works as expected.
   It looks like in that case during searching if there're any messages available a message id for the last message is found and the reader pointer is set for it.
   Logs:
   ```
   17:14:42.290 [] [pulsar-client-io-1-1] INFO Get topic last message Id
   17:14:42.290 [] [pulsar-client-io-1-1] INFO Successfully getLastMessageId 150:0
   17:14:42.293 [] [pulsar-client-io-1-1] INFO Seek subscription to message id 150:0:-1
   17:14:42.308 [] [pulsar-client-io-1-1] INFO Successfully reset subscription to message id 150:0:-1
   ```
   
   You can use it as a **workaround**, but still this issue should be fixed.


-- 
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