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

Boyang Chen commented on KAFKA-9993:
------------------------------------

Thanks [~vvcephei] An example is from the recent implementation for Raft: 

[https://github.com/confluentinc/kafka/pull/319/files#r424848803] a couple of 
common fields just as error code, leader id and later on cluster.id are 
attached to all the generated RPCs like vote, fetch, begin/end quorum, etc, but 
you have to manually extract them one by one without a common ancestor. It 
would be good to consolidate them.

Similar cases for group coordinator and txn coordinator code are definitely 
possible to be simplified, as they separate share a lot of common fields for 
sure.

> Think about inheritance in the protocol generation framework
> ------------------------------------------------------------
>
>                 Key: KAFKA-9993
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9993
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Boyang Chen
>            Priority: Major
>
> We have seen that there are a lot of common fields inside the 
> request/response templates that could be extracted as a super class for auto 
> generated classes. For example most response contains a top level error code. 
> Currently to build a service receiving multiple RPCs, the code template 
> produces a lot of redundant error code extraction logic which is far from 
> ideal. 
> What we want to discuss is whether to enable the general inheritance 
> mechanism in this framework, what's the trade-off and complexity increase, 
> and if there is any workaround just to make less boiler templates.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to