Created
July 5, 2023 20:10
-
-
Save Abdulsametileri/4d0de6307f101904dea08dbc67c316ca to your computer and use it in GitHub Desktop.
kafka-konsumer/without-retry-manager.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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