You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Angel Todorov <at...@gmail.com> on 2015/02/23 12:17:55 UTC

Messages aren't consumed immediately

Hi

I'm sending a message using this python code:

client = KafkaClient("localhost:9092")
producer = SimpleProducer(client)
producer.send_messages("mytopic", bytes("some msg", 'utf-8'))

Then i am consuming it using kafka-net in the following way:

            var options = new KafkaOptions(new Uri("http://10.0.1.106:9092"),
new Uri("http://10.0.1.106:9092"));
            var router = new BrokerRouter(options);
            ConsumerOptions opts = new ConsumerOptions("mytopic", router);
            var consumer = new Consumer(opts);

  foreach (var message in consumer.Consume())
            {
                  // do something with the message
              }

My problem is that once a message is sent, it takes between 1-2 up to 10
seconds until it is consumed in jafka-net. Is this normal? I'm using
default Kafka /zookeeper configs.

My expectation is that messages are received immediatelly.

Thanks
Angel