Messages vanish between kafka producer and consumer

67 views Asked by At

I have a very simple embedded kafka application: one producer thread and two consumer treads that write top postgres db. The three threads run in a single process. I am using librdkafka to implement my consumer and producer and run apache-kafka as a broker. Message size is approximately 2kB. I have two counters: one incremented when I write (rd_kafka_produce) and another incremented when I read (rd_kafka_consume_batch). If I run my producer fast enough (over 30000 messages/second) the producer counter ends up much larger than the consumer counter (15% or so if I run for 30 seconds). So I am loosing messages somewhere. My first question is how to debug such a problem? The second is what is most probable cause of this problem and how can I fix it?

0

There are 0 answers