feature: add consumer code
This commit is contained in:
parent
be69809fd0
commit
405fa5ec52
29
cmd/main.go
29
cmd/main.go
@ -40,4 +40,33 @@ func main() {
|
||||
log.Printf("unable to commit txn %s\n", err)
|
||||
return
|
||||
}
|
||||
|
||||
// ---- consumer ----
|
||||
//for {
|
||||
// log.Println("in the for")
|
||||
// select {
|
||||
// case msg := <-partitionConsumer.Messages():
|
||||
// log.Printf("Consumed message offset %d\n", msg.Offset)
|
||||
// if *logMsg {
|
||||
// log.Printf("KEY: %s VALUE: %s", msg.Key, msg.Value)
|
||||
// }
|
||||
// consumed++
|
||||
// case <-signals:
|
||||
// break ConsumerLoop
|
||||
// }
|
||||
//}
|
||||
|
||||
// SIGUSR1 toggle the pause/resume consumption
|
||||
//sigterm := make(chan os.Signal, 1)
|
||||
//signal.Notify(sigterm, syscall.SIGINT, syscall.SIGTERM)
|
||||
|
||||
//for keepRunning {
|
||||
// <-sigterm
|
||||
// log.Println("terminating: via signal")
|
||||
// keepRunning = false
|
||||
//}
|
||||
//cancel()
|
||||
//wg.Wait()
|
||||
|
||||
//producerProvider.Clear()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user