Re: About kafka 0.8 producer zookeeper-based load balancing on per-request basis

2013-01-15 Thread Neha Narkhede
>When the producer >tries to send to the old broker (which is either dead, or a slave now), >the broker will either not respond, or the response will contain an error >code. In this case, the broker sends a response with an error code to the producer, and then the producer retries the metadata r

Re: About kafka 0.8 producer zookeeper-based load balancing on per-request basis

2013-01-15 Thread Chris Riccomini
Hey Guys, Correct me if I'm wrong, but I believe in 0.8, the producer uses a metadata request to get topic/partition mappings from the broker. The broker then interacts with ZK (rather than having the producer do it using zk.connect). In the event that the master for a topic/partition fails, a ne

Re: About kafka 0.8 producer zookeeper-based load balancing on per-request basis

2013-01-15 Thread Jun Rao
All apis for 0.8 are documented in https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol However, there is no need for a producer to call the metadata api directly. Our producer client does this for you automatically. For your first question, if a new broker is added, cu

RE: About kafka 0.8 producer zookeeper-based load balancing on per-request basis

2013-01-14 Thread Jun Guo -X (jungu - CIIC at Cisco)
Thanks for your kindly reply. From: Jun Rao [mailto:jun...@gmail.com] Sent: 2013年1月15日 13:53 To: dev@kafka.apache.org; Jun Guo -X (jungu - CIIC at Cisco) Subject: Re: About kafka 0.8 producer zookeeper-based load balancing on per-request basis Basically, we spread partitions among multiple

RE: About kafka 0.8 producer zookeeper-based load balancing on per-request basis

2013-01-14 Thread Jun Guo -X (jungu - CIIC at Cisco)
@kafka.apache.org Cc: Jun Guo -X (jungu - CIIC at Cisco) Subject: Re: About kafka 0.8 producer zookeeper-based load balancing on per-request basis Than how it achieve zookeeper-based load balance on per-request basis? You are asking two related but different questions. One is how does load balancing work

Re: About kafka 0.8 producer zookeeper-based load balancing on per-request basis

2013-01-14 Thread Neha Narkhede
> > > Than how it achieve zookeeper-based load balance on per-request basis? You are asking two related but different questions. One is how does load balancing work and the other is how does broker discovery works. Jun explained how load balancing works and how requests are routed to partitons. I

Re: About kafka 0.8 producer zookeeper-based load balancing on per-request basis

2013-01-14 Thread Jun Rao
Basically, we spread partitions among multiple brokers. If a message is sent without a key, the producer picks a random partition to balance the load. If a message has a key, the default partitioner hashes the key to one of the partitions deterministically. Then, the load may not always be balanced