Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

By default, sarama outputs error messages to stdout #9

Closed
sbowman opened this issue Mar 13, 2015 · 1 comment
Closed

By default, sarama outputs error messages to stdout #9

sbowman opened this issue Mar 13, 2015 · 1 comment

Comments

@sbowman
Copy link

sbowman commented Mar 13, 2015

Some of the functionality in sarama-cluster relies on sarama passing error messages to the PartitionConsumer.Errors() channel. However, by default sarama will simply write errors from Kafka to the logger (stdout).

To support sarama-cluster, you need to configure the sarama.Client with Consumer.Return.Errors:

config := sarama.NewConfig()
config.Consumer.Return.Errors = true
client, err := sarama.NewClient(servers, config)

//...

consumer, err := cluster.NewConsumerFromClient(client, zookeepers, group, topic, clusterConfig)

It's only blind luck that I stumbled across this. This seems like a pretty big deal, but it's just briefly mentioned in one or two places in the sarama docs. See the description under https://godoc.org/github.com/Shopify/sarama#PartitionConsumer and the comments in https://godoc.org/github.com/Shopify/sarama#Config, under "Consumer".

@sbowman sbowman mentioned this issue Mar 13, 2015
@dim
Copy link
Member

dim commented Mar 20, 2015

Fixed in dae70a7

@dim dim closed this as completed Mar 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants