-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Staledoc-requiredYour PR changes impact docs and you will update later.Your PR changes impact docs and you will update later.
Description
Search before asking
- I searched in the issues and found nothing similar.
What issue do you find in Pulsar docs?
I think it would be useful to introduce the ReaderListener in the Reader interface introduction.
Whilst there is obviously a balance here, I think most (especially new) users would want to understand that there is a better way of processing messages than the documented while(true) loop.
What is your suggestion?
I would add something like the following:
Messages can be processed by registering an implementation of a ReaderInterface as follows:
Reader<byte[]> reader = pulsarClient.newReader()
.topic(topic)
.startMessageId(MessageId.latest)
.readerListener((ReaderListener<byte[]>) (reader, msg) -> {
// Process the message
})
.create();
Any reference?
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Staledoc-requiredYour PR changes impact docs and you will update later.Your PR changes impact docs and you will update later.