kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Gustafson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-2388) subscribe(topic)/unsubscribe(topic) should either take a callback to allow user to handle exceptions or it should be synchronous.
Date Mon, 03 Aug 2015 16:24:05 GMT

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

Jason Gustafson commented on KAFKA-2388:
----------------------------------------

[~becket_qin] If you don't mind, I can take a crack at this. No worries if you were planning
to do it.

> subscribe(topic)/unsubscribe(topic) should either take a callback to allow user to handle
exceptions or it should be synchronous.
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-2388
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2388
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Jiangjie Qin
>            Assignee: Jiangjie Qin
>
> According to the mailing list discussion on the consumer interface, we'll replace:
> {code}
> public void subscribe(String... topics);
> public void subscribe(TopicPartition... partitions);
> public Set<TopicPartition> subscriptions();
> {code}
> with:
> {code}
> void subscribe(List<String> topics, RebalanceCallback callback);
> void assign(List<TopicPartition> partitions);
> List<String> subscriptions();
> List<TopicPartition> assignments();
> {code}
> We don't need the unsubscribe APIs anymore.
> The RebalanceCallback would look like:
> {code}
> interface RebalanceCallback {
>   void onAssignment(List<TopicPartition> partitions);
>   void onRevocation(List<TopicPartition> partitions);
>   // handle non-existing topics, etc.
>   void onError(Exception e);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message