[
https://issues.apache.org/jira/browse/KAFKA-7787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053667#comment-17053667
]
Colin McCabe commented on KAFKA-7787:
-------------------------------------
Hi [~tombentley],
Sorry for the delay. We've been really busy lately.
This is very interesting. I like the fact that your implementation handles
generic enums, rather than just errors. As you mentioned, we have a general
pattern of using enums this way.
There are a few things we would need to make this useful. I guess one is the
ability to map unknown values to some UNKNOWN enum, kind of like we do with
many of the existing enum fields used in the RPC.
Another thing is that we need is some way of sharing enums across multiple
messages. The simplest way to do this is probably to add a new top-level JSON
type for this (so you'd have request, response, enum) and load all the enums
first in the code generator. We could also do an on-demand loading type of
thing, but that might be more than is needed here.
In the case of Errors, we need to associate each enum with a corresponding
exception. I guess we could have a helper class for this.
> Add error specifications to KAFKA-7609
> --------------------------------------
>
> Key: KAFKA-7787
> URL: https://issues.apache.org/jira/browse/KAFKA-7787
> Project: Kafka
> Issue Type: Sub-task
> Reporter: Colin McCabe
> Assignee: Tom Bentley
> Priority: Minor
>
> In our RPC JSON, it would be nice if we could specify what versions of a
> response could contain what errors. See the discussion here:
> https://github.com/apache/kafka/pull/5893#discussion_r244841051
--
This message was sent by Atlassian Jira
(v8.3.4#803005)