[ 
https://issues.apache.org/jira/browse/KAFKA-1316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14011498#comment-14011498
 ] 

Jun Rao commented on KAFKA-1316:
--------------------------------

A few thoughts on this.

1. NetworkClient wraps the logic for refreshing metadata. This works well with 
produce and fetch request. However, for requests (heartbeat, joinGroup, 
offsetCommit, etc) related to consumer coordination, their metadata needs to be 
refreshed using ConsumerMetadataRequest, instead of TopicMetadataRequest. 
Perhaps we can make the metadata handling part in NetworkClient more general so 
that it's not tied to TopicMetadataRequest.

2. If we can do #1, anther option is for the new consumer client to instantiate 
two instances of NetworkClient, one for handling fetch requests (requests that 
need to be handled at the leader of a partition) and another for handling 
requests (heartbeat, joinGroup, offsetCommit, etc) that need to be handled at 
the coordinator for a consumer group.

> 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
>
>
> 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)

Reply via email to