@@ -27,6 +27,7 @@ module Protocol
2727 API_VERSIONS_API = 18
2828 CREATE_TOPICS_API = 19
2929 DELETE_TOPICS_API = 20
30+ DESCRIBE_CONFIGS_API = 32
3031 CREATE_PARTITIONS_API = 37
3132
3233 # A mapping from numeric API keys to symbolic API names.
@@ -46,6 +47,7 @@ module Protocol
4647 API_VERSIONS_API => :api_versions ,
4748 CREATE_TOPICS_API => :create_topics ,
4849 DELETE_TOPICS_API => :delete_topics ,
50+ DESCRIBE_CONFIGS_API => :describe_configs_api ,
4951 CREATE_PARTITIONS_API => :create_partitions
5052 }
5153
@@ -91,6 +93,25 @@ module Protocol
9193 42 => InvalidRequest
9294 }
9395
96+ # A mapping from int to corresponding resource type in symbol.
97+ # https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/resource/ResourceType.java
98+ RESOURCE_TYPE_UNKNOWN = 0
99+ RESOURCE_TYPE_ANY = 1
100+ RESOURCE_TYPE_TOPIC = 2
101+ RESOURCE_TYPE_GROUP = 3
102+ RESOURCE_TYPE_CLUSTER = 4
103+ RESOURCE_TYPE_TRANSACTIONAL_ID = 5
104+ RESOURCE_TYPE_DELEGATION_TOKEN = 6
105+ RESOURCE_TYPES = {
106+ RESOURCE_TYPE_UNKNOWN => :unknown ,
107+ RESOURCE_TYPE_ANY => :any ,
108+ RESOURCE_TYPE_TOPIC => :topic ,
109+ RESOURCE_TYPE_GROUP => :group ,
110+ RESOURCE_TYPE_CLUSTER => :cluster ,
111+ RESOURCE_TYPE_TRANSACTIONAL_ID => :transactional_id ,
112+ RESOURCE_TYPE_DELEGATION_TOKEN => :delegation_token ,
113+ }
114+
94115 # Handles an error code by either doing nothing (if there was no error) or
95116 # by raising an appropriate exception.
96117 #
@@ -147,5 +168,7 @@ def self.api_name(api_key)
147168require "kafka/protocol/create_topics_response"
148169require "kafka/protocol/delete_topics_request"
149170require "kafka/protocol/delete_topics_response"
171+ require "kafka/protocol/describe_configs_request"
172+ require "kafka/protocol/describe_configs_response"
150173require "kafka/protocol/create_partitions_request"
151174require "kafka/protocol/create_partitions_response"
0 commit comments