Skip to content

Commit 7a5fbcb

Browse files
committed
Extract API number to a constant
1 parent 2e4c981 commit 7a5fbcb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/kafka/protocol.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module Protocol
2424
LEAVE_GROUP_API = 13
2525
SYNC_GROUP_API = 14
2626
SASL_HANDSHAKE_API = 17
27+
API_VERSIONS_API = 18
2728
CREATE_TOPICS_API = 19
2829

2930
# A mapping from numeric API keys to symbolic API names.
@@ -40,6 +41,7 @@ module Protocol
4041
LEAVE_GROUP_API => :leave_group,
4142
SYNC_GROUP_API => :sync_group,
4243
SASL_HANDSHAKE_API => :sasl_handshake,
44+
API_VERSIONS_API => :api_versions,
4345
CREATE_TOPICS_API => :create_topics,
4446
}
4547

lib/kafka/protocol/api_versions_request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Protocol
33

44
class ApiVersionsRequest
55
def api_key
6-
18
6+
API_VERSIONS_API
77
end
88

99
def encode(encoder)

0 commit comments

Comments
 (0)