[ https://issues.apache.org/jira/browse/KAFKA-1316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14025741#comment-14025741 ]
Neha Narkhede commented on KAFKA-1316: -------------------------------------- 2. hmm.. let me explain. So, both use metadata and hence, all metadata related configs. Both use some connection, so both need the backoff config. And both need a bootstrap list. I ended up copy pasting all of the common configs from the produce to consumer, so the possibility of sharing it crossed my mind :-) 3. I think I was lazy in explaining this one. Take 2 - In the producer or consumer, while sending a topic metadata request, it ends up using selectMetadataDestination that has the logic of determining which of the brokers can receive the metadata request. On the consumer, while sending a ConsumerMetadataRequest, it has to pick a node to send this request to. It turns out that the logic to do so is identical to what is wrapped up in selectMetadataDestination. I wonder if we can find a way to share it? > Refactor Sender > --------------- > > Key: KAFKA-1316 > URL: https://issues.apache.org/jira/browse/KAFKA-1316 > Project: Kafka > Issue Type: Sub-task > Components: producer > Reporter: Jay Kreps > Assignee: Jay Kreps > Attachments: KAFKA-1316.patch, KAFKA-1316_2014-06-03_11:15:38.patch, > KAFKA-1316_2014-06-03_14:33:33.patch, KAFKA-1316_2014-06-07_11:20:38.patch > > > Currently most of the logic of the producer I/O thread is in Sender.java. > However we will need to do a fair number of similar things in the new > consumer. Specifically: > - Track in-flight requests > - Fetch metadata > - Manage connection lifecycle > It may be possible to refactor some of this into a helper class that can be > shared with the consumer. This will require some detailed thought. -- This message was sent by Atlassian JIRA (v6.2#6252)