increase flexibility of ConsumerOps #95
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addition of a
ConsumerRetryConfig
object for providing the number of attempts and poll duration implicitly when callingconsumeLazily
.Some refactoring to allow one or many topics to be provided to
consumeLazily
instead of separate methods.Allow a transform function to be passed to
consumeLazily
to be run on allConsumerRecord
s consumed - allows users to decode aConsumerRecord
however they want (e.g. I've had times where I need to return the timestamp from aConsumerRecord
). This also means we can cover the use-case of theconsumeLazilyOnTopics
method which was extracting the topic from theConsumerRecord
.I have provided some implementations of this function in
Codecs
which I believe to be common usages.