signalRawNSQ := setUpNSQ("signal_insert", "raw", new(SignalInsertRaw))
func setUpNSQ(topic, channel string, handle nsq.Handler) *nsq.Reader {
// Setting up the NSQ reader
reader, err := nsq.NewReader(topic, channel)
if err != nil {
//fmt.Println(err.Error())
}
reader.SetMaxInFlight(100)
reader.AddHandler(handle)
reader.ConnectToLookupd("127.0.0.1:4161")
return reader
}
But the function only process 1 message at a time. Instead of multiple. What I'm I doing wrong here. Or it's this by design?
Note that I process up to 1000000 message per second. So most of the time the queue gets filled up. Even then it only process one job at a time in a single go program.