Hi Evan, The error code is per-partition, and for new producer only LeaderNotAvailable error will cause it to ignore the metadata for that partition. If you are using the producer clients directly you would not need to worry about these error handling details; if you are fetching the metadata using a metadata request yourself and then you need to handle the error code accordingly.
I agree that such documentation is kind of lacking for now, and we would better add that in the response class Java doc. Guozhang On Tue, Nov 25, 2014 at 12:29 PM, Evan Huus <[email protected]> wrote: > Hi folks, > > I was wondering in which cases the PartitionMetadata section of a > MetadataResponse [1] can contain useful information? > > I had been working under the assumption that when the PartitionErrorCode > was 0 (NoError) then the rest of the data would be legitimate, and that > when the error was non-0 then the rest of the data would be > blank/empty/etc. > > However, I recently discovered a JIRA ticket [2] which suggests otherwise, > namely that there are certain error codes for which parts of the remainder > of the metadata may still be filled in. I have not found any explicit > documentation for which error codes this is true. Does anybody know? > > Thanks, > Evan > > P.S. I'm not 100% sure if this kind of question should go on users@ or > dev@. > Please let me know if I'm in the wrong place. > > [1] > > https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-MetadataResponse > [2] https://issues.apache.org/jira/browse/KAFKA-1609 > -- -- Guozhang
