summaryrefslogtreecommitdiff
path: root/kafka
diff options
context:
space:
mode:
authorJeff Widman <jeff@jeffwidman.com>2017-02-08 17:16:10 -0800
committerDana Powers <dana.powers@gmail.com>2017-02-08 17:16:10 -0800
commitd309ccbec95ae9039cd7d60278567015030c1b76 (patch)
tree9197985e40f6e55a8d57511f9d4ebcac2e713659 /kafka
parentd215bd98236783dc5bcdf1f59d94fef1e254bab1 (diff)
downloadkafka-python-d309ccbec95ae9039cd7d60278567015030c1b76.tar.gz
Add JoinGroup v1 structs (#965)
The JoinGroupRequest struct added a rebalance_timeout as part of KIP-62 / KAFKA-3888
Diffstat (limited to 'kafka')
-rw-r--r--kafka/protocol/group.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/kafka/protocol/group.py b/kafka/protocol/group.py
index 98715f3..0e0b70e 100644
--- a/kafka/protocol/group.py
+++ b/kafka/protocol/group.py
@@ -19,6 +19,12 @@ class JoinGroupResponse_v0(Struct):
)
+class JoinGroupResponse_v1(Struct):
+ API_KEY = 11
+ API_VERSION = 1
+ SCHEMA = JoinGroupResponse_v0.SCHEMA
+
+
class JoinGroupRequest_v0(Struct):
API_KEY = 11
API_VERSION = 0
@@ -35,8 +41,25 @@ class JoinGroupRequest_v0(Struct):
UNKNOWN_MEMBER_ID = ''
-JoinGroupRequest = [JoinGroupRequest_v0]
-JoinGroupResponse = [JoinGroupResponse_v0]
+class JoinGroupRequest_v1(Struct):
+ API_KEY = 11
+ API_VERSION = 1
+ RESPONSE_TYPE = JoinGroupResponse_v1
+ SCHEMA = Schema(
+ ('group', String('utf-8')),
+ ('session_timeout', Int32),
+ ('rebalance_timeout', Int32),
+ ('member_id', String('utf-8')),
+ ('protocol_type', String('utf-8')),
+ ('group_protocols', Array(
+ ('protocol_name', String('utf-8')),
+ ('protocol_metadata', Bytes)))
+ )
+ UNKNOWN_MEMBER_ID = ''
+
+
+JoinGroupRequest = [JoinGroupRequest_v0, JoinGroupRequest_v1]
+JoinGroupResponse = [JoinGroupResponse_v0, JoinGroupResponse_v1]
class ProtocolMetadata(Struct):