Skip to content

Commit

Permalink
Merge pull request #1590 from Shopify/diego_fix-for-breaking-change
Browse files Browse the repository at this point in the history
Adds back Consumer.Offsets.CommitInterval to fix API
  • Loading branch information
d1egoaz authored Jan 29, 2020
2 parents 20880c3 + b74b4a2 commit b152be9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,11 @@ type Config struct {
// offsets. This currently requires the manual use of an OffsetManager
// but will eventually be automated.
Offsets struct {
// Deprecated: CommitInterval exists for historical compatibility
// and should not be used. Please use Consumer.Offsets.AutoCommit
CommitInterval time.Duration

// AutoCommit specifies configuration for commit messages automatically.
AutoCommit struct {
// Whether or not to auto-commit updated offsets back to the broker.
// (default enabled).
Expand Down Expand Up @@ -688,6 +693,11 @@ func (c *Config) Validate() error {
return ConfigurationError("Consumer.IsolationLevel must be ReadUncommitted or ReadCommitted")
}

if c.Consumer.Offsets.CommitInterval != 0 {
Logger.Println("Deprecation warning: Consumer.Offsets.CommitInterval exists for historical compatibility" +
" and should not be used. Please use Consumer.Offsets.AutoCommit, the current value will be ignored")
}

// validate IsolationLevel
if c.Consumer.IsolationLevel == ReadCommitted && !c.Version.IsAtLeast(V0_11_0_0) {
return ConfigurationError("ReadCommitted requires Version >= V0_11_0_0")
Expand Down

0 comments on commit b152be9

Please sign in to comment.