You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Carlos Rodriguez Fernandez <ca...@gmail.com> on 2016/08/01 23:31:10 UTC

Consumer poll in 0.9.0.1 hanging

Hi,
When using Apache Camel Kafka to consume messages, I notice that when the
topic is not created the fetching here:

   org.apache.camel.component.kafka.KafkaConsumer.run..

ConsumerRecords<Object, Object> records = consumer.poll(Long.MAX_VALUE);


... just hangs forever, even if I create the topic and publish messages. It
seems that I need to create the topic *before* the "poll" is invoked,
otherwise, the poll call never comes back not matter what I do.


Is this an expected behaviors?


Thank you,

Carlos.

Re: Consumer poll in 0.9.0.1 hanging

Posted by Carlos Rodriguez Fernandez <ca...@gmail.com>.
Thank you Eween for the help. I'll give that a try.
Regards,
Carlos.

On Tue, Aug 2, 2016, 10:12 PM Ewen Cheslack-Postava <ew...@confluent.io>
wrote:

> It seems like we definitely shouldn't block indefinitely, but what is
> probably happening is that the consumer is fetching metadata, not finding
> the topic, then getting hung up somewhere.
>
> It probably won't hang indefinitely -- there is a periodic refresh of
> metadata, defaulting to every 5 minutes, which should pick up the topic
> once you have created it. Presumably then it would start returning data.
>
> -Ewen
>
> On Mon, Aug 1, 2016 at 4:31 PM, Carlos Rodriguez Fernandez <
> carlosrodrifernandez@gmail.com> wrote:
>
> > Hi,
> > When using Apache Camel Kafka to consume messages, I notice that when the
> > topic is not created the fetching here:
> >
> >    org.apache.camel.component.kafka.KafkaConsumer.run..
> >
> > ConsumerRecords<Object, Object> records = consumer.poll(Long.MAX_VALUE);
> >
> >
> > ... just hangs forever, even if I create the topic and publish messages.
> It
> > seems that I need to create the topic *before* the "poll" is invoked,
> > otherwise, the poll call never comes back not matter what I do.
> >
> >
> > Is this an expected behaviors?
> >
> >
> > Thank you,
> >
> > Carlos.
> >
>
>
>
> --
> Thanks,
> Ewen
>

Re: Consumer poll in 0.9.0.1 hanging

Posted by Ewen Cheslack-Postava <ew...@confluent.io>.
It seems like we definitely shouldn't block indefinitely, but what is
probably happening is that the consumer is fetching metadata, not finding
the topic, then getting hung up somewhere.

It probably won't hang indefinitely -- there is a periodic refresh of
metadata, defaulting to every 5 minutes, which should pick up the topic
once you have created it. Presumably then it would start returning data.

-Ewen

On Mon, Aug 1, 2016 at 4:31 PM, Carlos Rodriguez Fernandez <
carlosrodrifernandez@gmail.com> wrote:

> Hi,
> When using Apache Camel Kafka to consume messages, I notice that when the
> topic is not created the fetching here:
>
>    org.apache.camel.component.kafka.KafkaConsumer.run..
>
> ConsumerRecords<Object, Object> records = consumer.poll(Long.MAX_VALUE);
>
>
> ... just hangs forever, even if I create the topic and publish messages. It
> seems that I need to create the topic *before* the "poll" is invoked,
> otherwise, the poll call never comes back not matter what I do.
>
>
> Is this an expected behaviors?
>
>
> Thank you,
>
> Carlos.
>



-- 
Thanks,
Ewen