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/04/25 15:05:04 UTC

[GitHub] [pulsar-client-go] wolfstudy commented on issue #223: Reader can not read new messages after subscribing with LatestMessageID

wolfstudy commented on issue #223:
URL: https://github.com/apache/pulsar-client-go/issues/223#issuecomment-619392817


   Thanks @cornelk  feedback,  @jiazhai maybe this is not a bug.
   
   In the first send, we can't read the message, because the reader `StartMessageID` option is `LatestMessageID()`, so in the second send, this reader should also not receive messages, right?
   
   Please refer to the following code:
   
   ```
   reader1, err := client.CreateReader(ReaderOptions{
   		Topic:                   topic,
   		StartMessageID:          EarliestMessageID(),
   		StartMessageIDInclusive: false,
   	})
   
   	ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
   	msg, err = reader1.Next(ctx)
   	assert.NoError(t, err)
   	assert.NotNil(t, msg)
   	cancel()
   ```


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