1
0
Fork 0

Log messages on Kafka startup/shutdown

This commit is contained in:
Gregory Eremin 2015-10-18 03:46:52 +03:00
parent 787156d3ba
commit 285d05cfd2
1 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,9 @@ var (
// Initialize sets up the kafka package.
func Initialize(brokers []string) {
log.Println("Initializing Kafka")
defer log.Println("Kafka is initialized")
conf := sarama.NewConfig()
conf.ClientID = "Satan Example"
@ -53,6 +56,9 @@ func Initialize(brokers []string) {
// Shutdown shuts down the kafka package.
func Shutdown() {
log.Println("Shutting down Kafka")
defer log.Println("Kafka was shut down")
if err := kafkaConsumer.Close(); err != nil {
panic(err)
}