feature: add consumer code

This commit is contained in:
RouxAntoine 2023-06-16 07:21:33 +02:00
parent be69809fd0
commit 405fa5ec52
Signed by: antoine
GPG Key ID: 098FB66FC0475E70

View File

@ -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()
}