Is kafka flush([timeout]) blocking?

472 Views Asked by At

I am trying to understand how I can speed up Kafka in my test environment where I am only sending one message.

I have written this go and have a flush with a timeout

   defer func() {
            p.Flush(100 * 1000)
            p.Close()
            close(tcpIn)
        }()

The code is running a little over 100sec, which is not ideal in testing. I am not sure about the working of flush is it because flush holds the channel open till the timeout even when the channel is empty.

If I don't want to remove the flush for production use, how can I speed up my test.

0

There are 0 best solutions below