Skip to content

Instantly share code, notes, and snippets.

@Abdulsametileri
Created July 5, 2023 20:10
Show Gist options
  • Save Abdulsametileri/4d0de6307f101904dea08dbc67c316ca to your computer and use it in GitHub Desktop.
Save Abdulsametileri/4d0de6307f101904dea08dbc67c316ca to your computer and use it in GitHub Desktop.
kafka-konsumer/without-retry-manager.go
func main() {
consumerCfg := &kafka.ConsumerConfig{
Reader: kafka.ReaderConfig{
Brokers: []string{"localhost:29092"},
Topic: "standart-topic",
GroupID: "standart-cg",
},
ConsumeFn: consumeFn,
RetryEnabled: false,
}
consumer, _ := kafka.NewConsumer(consumerCfg)
defer consumer.Stop()
consumer.Consume()
}
func consumeFn(message kafka.Message) error {
fmt.Printf("Message From %s with value %s", message.Topic, string(message.Value))
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment