Skip to content

Commit

Permalink
rename CreateDefaultConfig as NewConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogo Behrens committed Feb 23, 2018
1 parent 2d57eae commit 624f1f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kafka/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type ConsumerBuilder func(brokers []string, group, clientID string) (Consumer, e

// DefaultConsumerBuilder creates a Kafka consumer using the Sarama library.
func DefaultConsumerBuilder(brokers []string, group, clientID string) (Consumer, error) {
config := CreateDefaultConfig(clientID)
config := NewConfig(clientID)
return NewSaramaConsumer(brokers, group, config)
}

Expand All @@ -29,7 +29,7 @@ type ProducerBuilder func(brokers []string, clientID string, hasher func() hash.

// DefaultProducerBuilder creates a Kafka producer using the Sarama library.
func DefaultProducerBuilder(brokers []string, clientID string, hasher func() hash.Hash32) (Producer, error) {
config := CreateDefaultConfig(clientID)
config := NewConfig(clientID)
config.Producer.Partitioner = sarama.NewCustomHashPartitioner(hasher)
return NewProducer(brokers, &config.Config)
}
Expand Down
4 changes: 2 additions & 2 deletions kafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
cluster "github.com/bsm/sarama-cluster"
)

// CreateDefaultConfig creates a (bsm) sarama configuration with default values.
func CreateDefaultConfig(clientID string) *cluster.Config {
// NewConfig creates a (bsm) sarama configuration with default values.
func NewConfig(clientID string) *cluster.Config {
config := cluster.NewConfig()

config.Version = sarama.V0_10_1_0
Expand Down

0 comments on commit 624f1f5

Please sign in to comment.