You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Pierre-Yves Ritschard <py...@spootnik.org> on 2012/04/19 10:43:24 UTC

Producer creation when brokers are down

Hi,

Whenever there is a connectivity glitch between producers and brokers
the producers wait for the brokers to be available as expected. I
noticed that this is not the case for the initial Producer creation
though, the constructor will raise an exception. Is there a way to
tell the producer to wait for a zookeeper node to become available ?

  - pyr

Re: Producer creation when brokers are down

Posted by Jun Rao <ju...@gmail.com>.
If the producer can't make a connection to ZK during initialization, it
will wait until a timeout is reached and then fail. You can increase the
timeout (zk.connection.timeout.ms) if you want the producer to wait longer.

Thanks,

Jun

On Thu, Apr 19, 2012 at 8:59 AM, Pierre-Yves Ritschard <py...@spootnik.org>wrote:

> I wasn't being clear, the exception occurs when the zookeeper servers
> are down, not the brokers
>
> On Thu, Apr 19, 2012 at 4:10 PM, Jun Rao <ju...@gmail.com> wrote:
> > Pierre,
> >
> > Could you post the exact exception your saw during Producer
> initialization?
> > It's not clear to me from your message whether the exception is due to ZK
> > or broker.
> >
> > Thanks,
> >
> > Jun
> >
> > On Thu, Apr 19, 2012 at 1:43 AM, Pierre-Yves Ritschard <pyr@spootnik.org
> >wrote:
> >
> >> Hi,
> >>
> >> Whenever there is a connectivity glitch between producers and brokers
> >> the producers wait for the brokers to be available as expected. I
> >> noticed that this is not the case for the initial Producer creation
> >> though, the constructor will raise an exception. Is there a way to
> >> tell the producer to wait for a zookeeper node to become available ?
> >>
> >>  - pyr
> >>
>

Re: Producer creation when brokers are down

Posted by Pierre-Yves Ritschard <py...@spootnik.org>.
I wasn't being clear, the exception occurs when the zookeeper servers
are down, not the brokers

On Thu, Apr 19, 2012 at 4:10 PM, Jun Rao <ju...@gmail.com> wrote:
> Pierre,
>
> Could you post the exact exception your saw during Producer initialization?
> It's not clear to me from your message whether the exception is due to ZK
> or broker.
>
> Thanks,
>
> Jun
>
> On Thu, Apr 19, 2012 at 1:43 AM, Pierre-Yves Ritschard <py...@spootnik.org>wrote:
>
>> Hi,
>>
>> Whenever there is a connectivity glitch between producers and brokers
>> the producers wait for the brokers to be available as expected. I
>> noticed that this is not the case for the initial Producer creation
>> though, the constructor will raise an exception. Is there a way to
>> tell the producer to wait for a zookeeper node to become available ?
>>
>>  - pyr
>>

Re: Producer creation when brokers are down

Posted by Jun Rao <ju...@gmail.com>.
Pierre,

Could you post the exact exception your saw during Producer initialization?
It's not clear to me from your message whether the exception is due to ZK
or broker.

Thanks,

Jun

On Thu, Apr 19, 2012 at 1:43 AM, Pierre-Yves Ritschard <py...@spootnik.org>wrote:

> Hi,
>
> Whenever there is a connectivity glitch between producers and brokers
> the producers wait for the brokers to be available as expected. I
> noticed that this is not the case for the initial Producer creation
> though, the constructor will raise an exception. Is there a way to
> tell the producer to wait for a zookeeper node to become available ?
>
>  - pyr
>

Re: Producer creation when brokers are down

Posted by Bo Sun <do...@gmail.com>.
watch the zookeeper node ,when it exists, zk will callback you code, then
try to reconnect the kafka.

Thanks

On Thu, Apr 19, 2012 at 4:43 PM, Pierre-Yves Ritschard <py...@spootnik.org>wrote:

> Hi,
>
> Whenever there is a connectivity glitch between producers and brokers
> the producers wait for the brokers to be available as expected. I
> noticed that this is not the case for the initial Producer creation
> though, the constructor will raise an exception. Is there a way to
> tell the producer to wait for a zookeeper node to become available ?
>
>  - pyr
>