[ 
https://issues.apache.org/jira/browse/KAFKA-15277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kirk True updated KAFKA-15277:
------------------------------
    Description: 
The consumer refactoring project introduced another {{Consumer}} 
implementation, creating two different, coexisting implementations of the 
{{Consumer}} interface:
 * {{KafkaConsumer}} (AKA "existing", "legacy" consumer)
 * {{PrototypeAsyncConsumer}} (AKA "new", "refactored" consumer)

The goal of this task is to refactor the code via the delegation pattern so 
that we can keep a top-level {{KafkaConsumer}} but then delegate to another 
implementation under the covers. There will be two delegates at first:
 * {{LegacyKafkaConsumer}}
 * {{AsyncKafkaConsumer}}

{{LegacyKafkaConsumer}} essentially be a renamed {{{}KafkaConsumer{}}}. That 
implementation handles the existing group protocol. {{AsyncKafkaConsumer}} is 
renamed from {{PrototypeAsyncConsumer}} and will implement the new consumer 
group protocol from KIP-848. Both of those implementations will live in the 
"internals" sub-package to discourage their use.

This task is part of the work to implement support for the new KIP-848 consumer 
group protocol.

  was:
As mentioned above, there are presently two different, coexisting 
implementations of the {{Consumer}} interface: {{KafkaConsumer}} ("old") and 
{{PrototypeAsyncConsumer}} ("new"). Eventually, these will be reorganized using 
the delegation pattern. The top-level {{KafkaConsumer}} that implements the old 
protocol will be renamed as {{LegacyKafkaConsumerDelegate}} and 
{{PrototypeAsyncConsumer}} will be renamed as 
{{{}AsyncKafkaConsume{}}}{{{}rDelegate{}}}. It is assumed that neither 
{{{}AsyncKafkaConsume{}}}{{{}rDelegate{}}} nor 
{{{}LegacyKafkaConsume{}}}{{{}rDelegate{}}} will be top-level implementations 
of {{{}Consumer{}}}, but will likely implement an internal interface that is 
better suited to the needs of the top-level {{{}KafkaConsumer{}}}.

Provide the Java client support for the consumer delegates, including:
 * Create {{ConsumerDelegate}} interface
 * Clone {{{}KafkaConsumer{}}}, rename as {{LegacyKafkaConsumerDelegate}} and 
refactor to implement {{ConsumerDelegate}}
 * Rename {{PrototypeAsyncConsumer}} to {{AsyncKafkaConsumerDelegate}} and 
refactor to implement the {{ConsumerDelegate}} interface
 * Refactor the (original) {{KafkaConsumer}} to remove the core implementation, 
instead delegating to the {{{}ConsumerDelegate{}}}, which will be hard-coded to 
use {{LegacyKafkaConsumerDelegate}}
 * Once available (in KAFKA-15284), use the 
{{ConsumerGroupProtocolVersionResolver}} to determine which delegate to use

This task is part of the work to implement support for the new KIP-848 consumer 
group protocol.


> Design & implement support for internal Consumer delegates
> ----------------------------------------------------------
>
>                 Key: KAFKA-15277
>                 URL: https://issues.apache.org/jira/browse/KAFKA-15277
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: clients, consumer
>            Reporter: Kirk True
>            Assignee: Kirk True
>            Priority: Blocker
>              Labels: consumer-threading-refactor, kip-848, kip-848-e2e, 
> kip-848-preview
>
> The consumer refactoring project introduced another {{Consumer}} 
> implementation, creating two different, coexisting implementations of the 
> {{Consumer}} interface:
>  * {{KafkaConsumer}} (AKA "existing", "legacy" consumer)
>  * {{PrototypeAsyncConsumer}} (AKA "new", "refactored" consumer)
> The goal of this task is to refactor the code via the delegation pattern so 
> that we can keep a top-level {{KafkaConsumer}} but then delegate to another 
> implementation under the covers. There will be two delegates at first:
>  * {{LegacyKafkaConsumer}}
>  * {{AsyncKafkaConsumer}}
> {{LegacyKafkaConsumer}} essentially be a renamed {{{}KafkaConsumer{}}}. That 
> implementation handles the existing group protocol. {{AsyncKafkaConsumer}} is 
> renamed from {{PrototypeAsyncConsumer}} and will implement the new consumer 
> group protocol from KIP-848. Both of those implementations will live in the 
> "internals" sub-package to discourage their use.
> This task is part of the work to implement support for the new KIP-848 
> consumer group protocol.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to