IBM / sarama

Sarama is a Go library for Apache Kafka.
MIT License
11.55k stars 1.76k forks source link

Error creating producer #1279

Closed ariasf closed 5 years ago

ariasf commented 5 years ago
Versions
"GoVersion": "go1.6",
"GodepVersion": "v79"

"ImportPath": "github.com/Shopify/sarama",
"Comment": "v1.20.1-28-g0a21d90",
"Rev": "0a21d90df4f6266fdf28d603e5ef91f2426c362a"

    "ImportPath": "github.com/bsm/sarama-cluster",
"Comment": "v2.1.8-16-g96ddfcd",
"Rev": "96ddfcd36f56f11fc80ff0d466128c1825ace08a"

    "KAFKA_VERSION"="2.1.0"  (Confluent Kafka) 
Configuration
func getProducerConfig() (*sarama.Config) {
    c := sarama.NewConfig()
    c.Producer.Idempotent = true
    return c
}
Logs

invalid configuration (Idempotent producer requires Version >= V0_11_0_0)

Problem Description

Hello you guys, wanted to see if any of you have encountered this problem and if so how do you solve it? the log error message says that version needs to be greater than V0 11_0_0 but it doesn't say what dependency/lib needs to be updated.

I could not find an answer in google by pasting the exception message so I decided to ask you guys. LMK

Many thanks in advance.

sahilchug commented 5 years ago
config.Producer.RequiredAcks = sarama.WaitForAll
config.Net.MaxOpenRequests = 1
config.Version = sarama.V2_1_0_0

@ariasf You will need to set version explicitly and more options in Producer and Net properties of Config

ariasf commented 5 years ago

@sahilchug Thanks a lot declaring the version fix the problem! Thanks

varun06 commented 5 years ago

Please close the issue if it is no more an issue.