Re: non-blocking sends when cluster is down

2015-02-26 Thread Gary Ogden
Thanks Steven. We changed the code to ensure that the producer is only created one and reused so that the metadata fetch doesn't happen every send() call. On 26 February 2015 at 12:44, Steven Wu wrote: > metadata fetch only happens/blocks for the first time you call send. after > the metadata is

Re: non-blocking sends when cluster is down

2015-02-26 Thread Steven Wu
metadata fetch only happens/blocks for the first time you call send. after the metadata is retrieved can cached in memory. it will not block again. so yes, there is a possibility it can block. of course, if cluster is down and metadata was never fetched, then every send can block. metadata is also

Re: non-blocking sends when cluster is down

2015-02-26 Thread Gary Ogden
I was actually referring to the metadata fetch. Sorry I should have been more descriptive. I know we can decrease the metadata.fetch.timeout.ms setting to be a lot lower, but it's still blocking if it can't get the metadata. And I believe that the metadata fetch happens every time we call send()?

Re: non-blocking sends when cluster is down

2015-02-25 Thread Guozhang Wang
Hi Gray, The Java producer will block on send() when the buffer is full and block.on.buffer.full = true ( http://kafka.apache.org/documentation.html#newproducerconfigs). If you set the config to false the send() call will throw a BufferExhaustedException which, in your case, can be caught and igno

non-blocking sends when cluster is down

2015-02-25 Thread Gary Ogden
Say the entire kafka cluster is down and there's no brokers to connect to. Is it possible to use the java producer send method and not block until there's a timeout? Is it as simple as registering a callback method? We need the ability for our application to not have any kind of delay when sendin