heetch / felice

Felice is a nascent, opinionated Kafka library for Go, in Go
MIT License
20 stars 1 forks source link

consumer: rework Consumer API #52

Closed rogpeppe closed 4 years ago

rogpeppe commented 4 years ago

We'd like to make it easier to have a more flexible strategy for retrying message sending (e.g. retry only on some errors or for a message-dependant time), so remove the retry logic from felice, leaving it up to the caller to determine.

This means that we need to pass the Context to the handler (so that a retrying handler can know when to abort when the context is done) and also enough information that appropriate metrics can be sent.

Doing this means we can also simplify the configuration, because we don't need to log or send metrics here any more (that can be done in handler wrappers themselves).

We also a address couple of issues in the existing implementation:

Fixes issue #50.