write to kafka using request handler channel
This commit is contained in:
11
main.go
11
main.go
@@ -2,9 +2,10 @@ package main
|
||||
|
||||
|
||||
import (
|
||||
lib "com.navi.medici.janus/lib"
|
||||
config "com.navi.medici.janus/config"
|
||||
producer_module "com.navi.medici.janus/producer"
|
||||
server "com.navi.medici.janus/server"
|
||||
producer_module "com.navi.medici.janus/producer"
|
||||
|
||||
"fmt"
|
||||
"log"
|
||||
@@ -48,11 +49,17 @@ func init() {
|
||||
log.Printf(configuration.SchemaRegistry.Endpoint)
|
||||
|
||||
producer_module.GetSchemaVersions(configuration.SchemaRegistry.Endpoint, strings.Split(configuration.SchemaRegistry.Topics, ","))
|
||||
producer_module.InitializeProducers(configuration.Kafka)
|
||||
|
||||
// TO DO: read number of goroutines from config
|
||||
for i := 0; i < 10; i++ {
|
||||
go lib.ProcessRequestChannel()
|
||||
}
|
||||
|
||||
// sync producer using sarama
|
||||
// sync_producer := producer_module.GetSyncProducer(configuration.Kafka)
|
||||
// log.Println(sync_producer)
|
||||
// producer_module.KafkaWriter(sync_producer)
|
||||
// producer_module.KafkaWriter(sync_producer, topic, messageToSendBytes)
|
||||
// sync_producer.Close()
|
||||
|
||||
// async producer using sarama
|
||||
|
||||
Reference in New Issue
Block a user