Skip to content

Conversation

smoya
Copy link
Contributor

@smoya smoya commented Oct 21, 2020

In an effort to help users of our Kafka lib with common use cases, this PR adds a Factory function type, which can be used for postponing the creation of a consumer on runtime. E.g. setting an initial offset that you don't know on boot time.

NewConsumer and NewDetachedConsumer implements this already.

@smoya smoya added enhancement type: chore work needed to keep the product and development running smoothly labels Oct 21, 2020
@smoya smoya requested a review from a team as a code owner October 21, 2020 14:56
@smoya smoya self-assigned this Oct 21, 2020
@smoya smoya requested a review from a team October 21, 2020 14:57
@@ -62,7 +67,7 @@ type ConfluentConsumer struct {
// permission on the group coordinator for managing commits, so it needs a consumer group in the broker.
// In order to simplify, the default consumer group id is copied from the configured topic name, so make sure you have a
// policy that gives permission to such consumer group.
func NewDetachedConsumer(log logrus.FieldLogger, conf Config, opts ...ConfigOpt) (*ConfluentConsumer, error) {
func NewDetachedConsumer(log logrus.FieldLogger, conf Config, opts ...ConfigOpt) (Consumer, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bc is under control 👍

@smoya smoya requested a review from aarushik93 October 21, 2020 15:37
@smoya smoya merged commit b0289cc into master Oct 22, 2020
@smoya smoya deleted the feat/kafkaConsumerFactory branch October 22, 2020 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants