Changing subject back to DISCUSS.
> On Aug 20, 2018, at 6:52 AM, Jan Filipiak <[email protected]> wrote:
>
> Just saying that we should peek at the Samza approach, it's a much more
> powerful abstraction. We can ship a default MessageChooser
> that looks at the topics priority.
Thanks Jan for your input.
Here’s an attempt at incorporating a Samza MessageChooser type interface.
--
Nick
New interface TopicPrioritizer allows one to create a method implementation
that prioritizes topics. The topic priorities that were assigned with method
KafkaConsumer.subscribe may or may not be used. The input is the list of
subscribed topics, and output is ordered list of topics. The ordering
represents the priority that the TopicPrioritizer implementation has assigned.
Calls to KafkaConsumer.poll will use the TopicPrioritizer to determine the
priority of topics.
interface TopicPrioritizer {
List<TopicPriority> prioritize(List<TopicPriority> topicPriorities);
}
New method KafkaConsumer.registerTopicPrioritizer is used to register the
TopicPrioritizer
public void registerTopicPrioritizer(TopicPrioritizer topicPrioritizer);