Re: How to keep consumers alive without polling new messages

2016-09-28 Thread Yifan Ying
Thanks Vincent and Kamal. That solves my problem. :) Yifan On Tue, Sep 27, 2016 at 11:36 PM, Kamal C wrote: > You can refer this example[1] > > [1]: > https://github.com/omkreddy/kafka-examples/blob/master/ > consumer/src/main/java/kafka/examples/consumer/advanced/ > AdvancedConsumer.java > > -

Re: How to keep consumers alive without polling new messages

2016-09-27 Thread Kamal C
You can refer this example[1] [1]: https://github.com/omkreddy/kafka-examples/blob/master/consumer/src/main/java/kafka/examples/consumer/advanced/AdvancedConsumer.java - Kamal On Wed, Sep 28, 2016 at 11:33 AM, Vincent Dautremont < vincent.dautrem...@olamobile.com> wrote: > I had the same proble

Re: How to keep consumers alive without polling new messages

2016-09-27 Thread Vincent Dautremont
I had the same problem : Call pause() on all partitions. Then continue your loop that calls consume(), it will then poll without consuming messages. When you want to consume again, call resume() on all partition It's not obvious at all, the doc should explain that in the documentation of method

How to keep consumers alive without polling new messages

2016-09-27 Thread Yifan Ying
Hi all, 0.10 consumers use poll() method to heartbeat Kafka brokers. Is there any way that I can make the consumer heartbeat but not poll any messages? The javadoc says, the recommended way is to move message processing to another thread. But when message processing keeps failing(because a third p