blob: 8103c48fa68b5875009684be1f9ab022a4b3b9b6 [file] [log] [blame]
<h5>Headers:</h5>
<pre class="line-numbers"><code class="language-java">Request Header => api_key api_version correlation_id client_id
api_key => INT16
api_version => INT16
correlation_id => INT32
client_id => NULLABLE_STRING
</code></pre>
<table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>api_key</td><td>The id of the request type.</td></tr>
<tr>
<td>api_version</td><td>The version of the API.</td></tr>
<tr>
<td>correlation_id</td><td>A user-supplied integer value that will be passed back with the response</td></tr>
<tr>
<td>client_id</td><td>A user specified identifier for the client making the request.</td></tr>
</table>
<pre class="line-numbers"><code class="language-java">Response Header => correlation_id
correlation_id => INT32
</code></pre>
<table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>correlation_id</td><td>The user-supplied value passed in with the request</td></tr>
</table>
<h5>Produce API (Key: 0):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">Produce Request (Version: 0) => acks timeout [topic_data]
acks => INT16
timeout => INT32
topic_data => topic [data]
topic => STRING
data => partition record_set
partition => INT32
record_set => BYTES
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>acks</td><td>The number of nodes that should replicate the produce before returning. -1 indicates the full ISR.</td></tr>
<tr>
<td>timeout</td><td>The time to await a response in ms.</td></tr>
<tr>
<td>topic_data</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>data</td><td></td></tr>
<tr>
<td>partition</td><td></td></tr>
<tr>
<td>record_set</td><td></td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">Produce Request (Version: 1) => acks timeout [topic_data]
acks => INT16
timeout => INT32
topic_data => topic [data]
topic => STRING
data => partition record_set
partition => INT32
record_set => BYTES
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>acks</td><td>The number of nodes that should replicate the produce before returning. -1 indicates the full ISR.</td></tr>
<tr>
<td>timeout</td><td>The time to await a response in ms.</td></tr>
<tr>
<td>topic_data</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>data</td><td></td></tr>
<tr>
<td>partition</td><td></td></tr>
<tr>
<td>record_set</td><td></td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">Produce Response (Version: 0) => [responses]
responses => topic [partition_responses]
topic => STRING
partition_responses => partition error_code base_offset
partition => INT32
error_code => INT16
base_offset => INT64
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td></td></tr>
<tr>
<td>error_code</td><td></td></tr>
<tr>
<td>base_offset</td><td></td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">Produce Response (Version: 1) => [responses] throttle_time_ms
responses => topic [partition_responses]
topic => STRING
partition_responses => partition error_code base_offset
partition => INT32
error_code => INT16
base_offset => INT64
throttle_time_ms => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td></td></tr>
<tr>
<td>error_code</td><td></td></tr>
<tr>
<td>base_offset</td><td></td></tr>
<tr>
<td>throttle_time_ms</td><td>Duration in milliseconds for which the request was throttled due to quota violation. (Zero if the request did not violate any quota.)</td></tr>
</table>
</p>
<h5>Fetch API (Key: 1):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">Fetch Request (Version: 0) => replica_id max_wait_time min_bytes [topics]
replica_id => INT32
max_wait_time => INT32
min_bytes => INT32
topics => topic [partitions]
topic => STRING
partitions => partition fetch_offset max_bytes
partition => INT32
fetch_offset => INT64
max_bytes => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>replica_id</td><td>Broker id of the follower. For normal consumers, use -1.</td></tr>
<tr>
<td>max_wait_time</td><td>Maximum time in ms to wait for the response.</td></tr>
<tr>
<td>min_bytes</td><td>Minimum bytes to accumulate in the response.</td></tr>
<tr>
<td>topics</td><td>Topics to fetch.</td></tr>
<tr>
<td>topic</td><td>Topic to fetch.</td></tr>
<tr>
<td>partitions</td><td>Partitions to fetch.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>fetch_offset</td><td>Message offset.</td></tr>
<tr>
<td>max_bytes</td><td>Maximum bytes to fetch.</td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">Fetch Request (Version: 1) => replica_id max_wait_time min_bytes [topics]
replica_id => INT32
max_wait_time => INT32
min_bytes => INT32
topics => topic [partitions]
topic => STRING
partitions => partition fetch_offset max_bytes
partition => INT32
fetch_offset => INT64
max_bytes => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>replica_id</td><td>Broker id of the follower. For normal consumers, use -1.</td></tr>
<tr>
<td>max_wait_time</td><td>Maximum time in ms to wait for the response.</td></tr>
<tr>
<td>min_bytes</td><td>Minimum bytes to accumulate in the response.</td></tr>
<tr>
<td>topics</td><td>Topics to fetch.</td></tr>
<tr>
<td>topic</td><td>Topic to fetch.</td></tr>
<tr>
<td>partitions</td><td>Partitions to fetch.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>fetch_offset</td><td>Message offset.</td></tr>
<tr>
<td>max_bytes</td><td>Maximum bytes to fetch.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">Fetch Response (Version: 0) => [responses]
responses => topic [partition_responses]
topic => STRING
partition_responses => partition error_code high_watermark record_set
partition => INT32
error_code => INT16
high_watermark => INT64
record_set => BYTES
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>error_code</td><td></td></tr>
<tr>
<td>high_watermark</td><td>Last committed offset.</td></tr>
<tr>
<td>record_set</td><td></td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">Fetch Response (Version: 1) => throttle_time_ms [responses]
throttle_time_ms => INT32
responses => topic [partition_responses]
topic => STRING
partition_responses => partition error_code high_watermark record_set
partition => INT32
error_code => INT16
high_watermark => INT64
record_set => BYTES
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>throttle_time_ms</td><td>Duration in milliseconds for which the request was throttled due to quota violation. (Zero if the request did not violate any quota.)</td></tr>
<tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>error_code</td><td></td></tr>
<tr>
<td>high_watermark</td><td>Last committed offset.</td></tr>
<tr>
<td>record_set</td><td></td></tr>
</table>
</p>
<h5>Offsets API (Key: 2):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">Offsets Request (Version: 0) => replica_id [topics]
replica_id => INT32
topics => topic [partitions]
topic => STRING
partitions => partition timestamp max_num_offsets
partition => INT32
timestamp => INT64
max_num_offsets => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>replica_id</td><td>Broker id of the follower. For normal consumers, use -1.</td></tr>
<tr>
<td>topics</td><td>Topics to list offsets.</td></tr>
<tr>
<td>topic</td><td>Topic to list offset.</td></tr>
<tr>
<td>partitions</td><td>Partitions to list offset.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>timestamp</td><td>Timestamp.</td></tr>
<tr>
<td>max_num_offsets</td><td>Maximum offsets to return.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">Offsets Response (Version: 0) => [responses]
responses => topic [partition_responses]
topic => STRING
partition_responses => partition error_code [offsets]
partition => INT32
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>error_code</td><td></td></tr>
<tr>
<td>offsets</td><td>A list of offsets.</td></tr>
</table>
</p>
<h5>Metadata API (Key: 3):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">Metadata Request (Version: 0) => [topics]
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>topics</td><td>An array of topics to fetch metadata for. If no topics are specified fetch metadata for all topics.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">Metadata Response (Version: 0) => [brokers] [topic_metadata]
brokers => node_id host port
node_id => INT32
host => STRING
port => INT32
topic_metadata => topic_error_code topic [partition_metadata]
topic_error_code => INT16
topic => STRING
partition_metadata => partition_error_code partition_id leader [replicas] [isr]
partition_error_code => INT16
partition_id => INT32
leader => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>brokers</td><td>Host and port information for all brokers.</td></tr>
<tr>
<td>node_id</td><td>The broker id.</td></tr>
<tr>
<td>host</td><td>The hostname of the broker.</td></tr>
<tr>
<td>port</td><td>The port on which the broker accepts requests.</td></tr>
<tr>
<td>topic_metadata</td><td></td></tr>
<tr>
<td>topic_error_code</td><td>The error code for the given topic.</td></tr>
<tr>
<td>topic</td><td>The name of the topic</td></tr>
<tr>
<td>partition_metadata</td><td>Metadata for each partition of the topic.</td></tr>
<tr>
<td>partition_error_code</td><td>The error code for the partition, if any.</td></tr>
<tr>
<td>partition_id</td><td>The id of the partition.</td></tr>
<tr>
<td>leader</td><td>The id of the broker acting as leader for this partition.</td></tr>
<tr>
<td>replicas</td><td>The set of all nodes that host this partition.</td></tr>
<tr>
<td>isr</td><td>The set of nodes that are in sync with the leader for this partition.</td></tr>
</table>
</p>
<h5>LeaderAndIsr API (Key: 4):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">LeaderAndIsr Request (Version: 0) => controller_id controller_epoch [partition_states] [live_leaders]
controller_id => INT32
controller_epoch => INT32
partition_states => topic partition controller_epoch leader leader_epoch [isr] zk_version [replicas]
topic => STRING
partition => INT32
controller_epoch => INT32
leader => INT32
leader_epoch => INT32
zk_version => INT32
live_leaders => id host port
id => INT32
host => STRING
port => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>controller_id</td><td>The controller id.</td></tr>
<tr>
<td>controller_epoch</td><td>The controller epoch.</td></tr>
<tr>
<td>partition_states</td><td></td></tr>
<tr>
<td>topic</td><td>Topic name.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>controller_epoch</td><td>The controller epoch.</td></tr>
<tr>
<td>leader</td><td>The broker id for the leader.</td></tr>
<tr>
<td>leader_epoch</td><td>The leader epoch.</td></tr>
<tr>
<td>isr</td><td>The in sync replica ids.</td></tr>
<tr>
<td>zk_version</td><td>The ZK version.</td></tr>
<tr>
<td>replicas</td><td>The replica ids.</td></tr>
<tr>
<td>live_leaders</td><td></td></tr>
<tr>
<td>id</td><td>The broker id.</td></tr>
<tr>
<td>host</td><td>The hostname of the broker.</td></tr>
<tr>
<td>port</td><td>The port on which the broker accepts requests.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">LeaderAndIsr Response (Version: 0) => error_code [partitions]
error_code => INT16
partitions => topic partition error_code
topic => STRING
partition => INT32
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td>Error code.</td></tr>
<tr>
<td>partitions</td><td></td></tr>
<tr>
<td>topic</td><td>Topic name.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>error_code</td><td>Error code.</td></tr>
</table>
</p>
<h5>StopReplica API (Key: 5):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">StopReplica Request (Version: 0) => controller_id controller_epoch delete_partitions [partitions]
controller_id => INT32
controller_epoch => INT32
delete_partitions => INT8
partitions => topic partition
topic => STRING
partition => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>controller_id</td><td>The controller id.</td></tr>
<tr>
<td>controller_epoch</td><td>The controller epoch.</td></tr>
<tr>
<td>delete_partitions</td><td>Boolean which indicates if replica's partitions must be deleted.</td></tr>
<tr>
<td>partitions</td><td></td></tr>
<tr>
<td>topic</td><td>Topic name.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">StopReplica Response (Version: 0) => error_code [partitions]
error_code => INT16
partitions => topic partition error_code
topic => STRING
partition => INT32
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td>Error code.</td></tr>
<tr>
<td>partitions</td><td></td></tr>
<tr>
<td>topic</td><td>Topic name.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>error_code</td><td>Error code.</td></tr>
</table>
</p>
<h5>UpdateMetadata API (Key: 6):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">UpdateMetadata Request (Version: 0) => controller_id controller_epoch [partition_states] [live_brokers]
controller_id => INT32
controller_epoch => INT32
partition_states => topic partition controller_epoch leader leader_epoch [isr] zk_version [replicas]
topic => STRING
partition => INT32
controller_epoch => INT32
leader => INT32
leader_epoch => INT32
zk_version => INT32
live_brokers => id host port
id => INT32
host => STRING
port => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>controller_id</td><td>The controller id.</td></tr>
<tr>
<td>controller_epoch</td><td>The controller epoch.</td></tr>
<tr>
<td>partition_states</td><td></td></tr>
<tr>
<td>topic</td><td>Topic name.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>controller_epoch</td><td>The controller epoch.</td></tr>
<tr>
<td>leader</td><td>The broker id for the leader.</td></tr>
<tr>
<td>leader_epoch</td><td>The leader epoch.</td></tr>
<tr>
<td>isr</td><td>The in sync replica ids.</td></tr>
<tr>
<td>zk_version</td><td>The ZK version.</td></tr>
<tr>
<td>replicas</td><td>The replica ids.</td></tr>
<tr>
<td>live_brokers</td><td></td></tr>
<tr>
<td>id</td><td>The broker id.</td></tr>
<tr>
<td>host</td><td>The hostname of the broker.</td></tr>
<tr>
<td>port</td><td>The port on which the broker accepts requests.</td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">UpdateMetadata Request (Version: 1) => controller_id controller_epoch [partition_states] [live_brokers]
controller_id => INT32
controller_epoch => INT32
partition_states => topic partition controller_epoch leader leader_epoch [isr] zk_version [replicas]
topic => STRING
partition => INT32
controller_epoch => INT32
leader => INT32
leader_epoch => INT32
zk_version => INT32
live_brokers => id [end_points]
id => INT32
end_points => port host security_protocol_type
port => INT32
host => STRING
security_protocol_type => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>controller_id</td><td>The controller id.</td></tr>
<tr>
<td>controller_epoch</td><td>The controller epoch.</td></tr>
<tr>
<td>partition_states</td><td></td></tr>
<tr>
<td>topic</td><td>Topic name.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>controller_epoch</td><td>The controller epoch.</td></tr>
<tr>
<td>leader</td><td>The broker id for the leader.</td></tr>
<tr>
<td>leader_epoch</td><td>The leader epoch.</td></tr>
<tr>
<td>isr</td><td>The in sync replica ids.</td></tr>
<tr>
<td>zk_version</td><td>The ZK version.</td></tr>
<tr>
<td>replicas</td><td>The replica ids.</td></tr>
<tr>
<td>live_brokers</td><td></td></tr>
<tr>
<td>id</td><td>The broker id.</td></tr>
<tr>
<td>end_points</td><td></td></tr>
<tr>
<td>port</td><td>The port on which the broker accepts requests.</td></tr>
<tr>
<td>host</td><td>The hostname of the broker.</td></tr>
<tr>
<td>security_protocol_type</td><td>The security protocol type.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">UpdateMetadata Response (Version: 0) => error_code
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td>Error code.</td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">UpdateMetadata Response (Version: 1) => error_code
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td>Error code.</td></tr>
</table>
</p>
<h5>ControlledShutdown API (Key: 7):</h5>
<b>Requests:</b><br>
</p>
<p><pre class="line-numbers"><code class="language-java">ControlledShutdown Request (Version: 1) => broker_id
broker_id => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>broker_id</td><td>The id of the broker for which controlled shutdown has been requested.</td></tr>
</table>
</p>
<b>Responses:</b><br>
</p>
<p><pre class="line-numbers"><code class="language-java">ControlledShutdown Response (Version: 1) => error_code [partitions_remaining]
error_code => INT16
partitions_remaining => topic partition
topic => STRING
partition => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td></td></tr>
<tr>
<td>partitions_remaining</td><td>The partitions that the broker still leads.</td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
</table>
</p>
<h5>OffsetCommit API (Key: 8):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">OffsetCommit Request (Version: 0) => group_id [topics]
group_id => STRING
topics => topic [partitions]
topic => STRING
partitions => partition offset metadata
partition => INT32
offset => INT64
metadata => STRING
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td>The group id.</td></tr>
<tr>
<td>topics</td><td>Topics to commit offsets.</td></tr>
<tr>
<td>topic</td><td>Topic to commit.</td></tr>
<tr>
<td>partitions</td><td>Partitions to commit offsets.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>offset</td><td>Message offset to be committed.</td></tr>
<tr>
<td>metadata</td><td>Any associated metadata the client wants to keep.</td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">OffsetCommit Request (Version: 1) => group_id group_generation_id member_id [topics]
group_id => STRING
group_generation_id => INT32
member_id => STRING
topics => topic [partitions]
topic => STRING
partitions => partition offset timestamp metadata
partition => INT32
offset => INT64
timestamp => INT64
metadata => STRING
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td>The group id.</td></tr>
<tr>
<td>group_generation_id</td><td>The generation of the group.</td></tr>
<tr>
<td>member_id</td><td>The member id assigned by the group coordinator.</td></tr>
<tr>
<td>topics</td><td>Topics to commit offsets.</td></tr>
<tr>
<td>topic</td><td>Topic to commit.</td></tr>
<tr>
<td>partitions</td><td>Partitions to commit offsets.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>offset</td><td>Message offset to be committed.</td></tr>
<tr>
<td>timestamp</td><td>Timestamp of the commit</td></tr>
<tr>
<td>metadata</td><td>Any associated metadata the client wants to keep.</td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">OffsetCommit Request (Version: 2) => group_id group_generation_id member_id retention_time [topics]
group_id => STRING
group_generation_id => INT32
member_id => STRING
retention_time => INT64
topics => topic [partitions]
topic => STRING
partitions => partition offset metadata
partition => INT32
offset => INT64
metadata => STRING
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td>The group id.</td></tr>
<tr>
<td>group_generation_id</td><td>The generation of the consumer group.</td></tr>
<tr>
<td>member_id</td><td>The consumer id assigned by the group coordinator.</td></tr>
<tr>
<td>retention_time</td><td>Time period in ms to retain the offset.</td></tr>
<tr>
<td>topics</td><td>Topics to commit offsets.</td></tr>
<tr>
<td>topic</td><td>Topic to commit.</td></tr>
<tr>
<td>partitions</td><td>Partitions to commit offsets.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>offset</td><td>Message offset to be committed.</td></tr>
<tr>
<td>metadata</td><td>Any associated metadata the client wants to keep.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">OffsetCommit Response (Version: 0) => [responses]
responses => topic [partition_responses]
topic => STRING
partition_responses => partition error_code
partition => INT32
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>error_code</td><td></td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">OffsetCommit Response (Version: 1) => [responses]
responses => topic [partition_responses]
topic => STRING
partition_responses => partition error_code
partition => INT32
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>error_code</td><td></td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">OffsetCommit Response (Version: 2) => [responses]
responses => topic [partition_responses]
topic => STRING
partition_responses => partition error_code
partition => INT32
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>error_code</td><td></td></tr>
</table>
</p>
<h5>OffsetFetch API (Key: 9):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">OffsetFetch Request (Version: 0) => group_id [topics]
group_id => STRING
topics => topic [partitions]
topic => STRING
partitions => partition
partition => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td>The consumer group id.</td></tr>
<tr>
<td>topics</td><td>Topics to fetch offsets.</td></tr>
<tr>
<td>topic</td><td>Topic to fetch offset.</td></tr>
<tr>
<td>partitions</td><td>Partitions to fetch offsets.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">OffsetFetch Request (Version: 1) => group_id [topics]
group_id => STRING
topics => topic [partitions]
topic => STRING
partitions => partition
partition => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td>The consumer group id.</td></tr>
<tr>
<td>topics</td><td>Topics to fetch offsets.</td></tr>
<tr>
<td>topic</td><td>Topic to fetch offset.</td></tr>
<tr>
<td>partitions</td><td>Partitions to fetch offsets.</td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">OffsetFetch Response (Version: 0) => [responses]
responses => topic [partition_responses]
topic => STRING
partition_responses => partition offset metadata error_code
partition => INT32
offset => INT64
metadata => STRING
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>offset</td><td>Last committed message offset.</td></tr>
<tr>
<td>metadata</td><td>Any associated metadata the client wants to keep.</td></tr>
<tr>
<td>error_code</td><td></td></tr>
</table>
</p>
<p><pre class="line-numbers"><code class="language-java">OffsetFetch Response (Version: 1) => [responses]
responses => topic [partition_responses]
topic => STRING
partition_responses => partition offset metadata error_code
partition => INT32
offset => INT64
metadata => STRING
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>responses</td><td></td></tr>
<tr>
<td>topic</td><td></td></tr>
<tr>
<td>partition_responses</td><td></td></tr>
<tr>
<td>partition</td><td>Topic partition id.</td></tr>
<tr>
<td>offset</td><td>Last committed message offset.</td></tr>
<tr>
<td>metadata</td><td>Any associated metadata the client wants to keep.</td></tr>
<tr>
<td>error_code</td><td></td></tr>
</table>
</p>
<h5>GroupCoordinator API (Key: 10):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">GroupCoordinator Request (Version: 0) => group_id
group_id => STRING
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td>The unique group id.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">GroupCoordinator Response (Version: 0) => error_code coordinator
error_code => INT16
coordinator => node_id host port
node_id => INT32
host => STRING
port => INT32
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td></td></tr>
<tr>
<td>coordinator</td><td>Host and port information for the coordinator for a consumer group.</td></tr>
<tr>
<td>node_id</td><td>The broker id.</td></tr>
<tr>
<td>host</td><td>The hostname of the broker.</td></tr>
<tr>
<td>port</td><td>The port on which the broker accepts requests.</td></tr>
</table>
</p>
<h5>JoinGroup API (Key: 11):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">JoinGroup Request (Version: 0) => group_id session_timeout member_id protocol_type [group_protocols]
group_id => STRING
session_timeout => INT32
member_id => STRING
protocol_type => STRING
group_protocols => protocol_name protocol_metadata
protocol_name => STRING
protocol_metadata => BYTES
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td>The group id.</td></tr>
<tr>
<td>session_timeout</td><td>The coordinator considers the consumer dead if it receives no heartbeat after this timeout in ms.</td></tr>
<tr>
<td>member_id</td><td>The assigned consumer id or an empty string for a new consumer.</td></tr>
<tr>
<td>protocol_type</td><td>Unique name for class of protocols implemented by group</td></tr>
<tr>
<td>group_protocols</td><td>List of protocols that the member supports</td></tr>
<tr>
<td>protocol_name</td><td></td></tr>
<tr>
<td>protocol_metadata</td><td></td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">JoinGroup Response (Version: 0) => error_code generation_id group_protocol leader_id member_id [members]
error_code => INT16
generation_id => INT32
group_protocol => STRING
leader_id => STRING
member_id => STRING
members => member_id member_metadata
member_id => STRING
member_metadata => BYTES
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td></td></tr>
<tr>
<td>generation_id</td><td>The generation of the consumer group.</td></tr>
<tr>
<td>group_protocol</td><td>The group protocol selected by the coordinator</td></tr>
<tr>
<td>leader_id</td><td>The leader of the group</td></tr>
<tr>
<td>member_id</td><td>The consumer id assigned by the group coordinator.</td></tr>
<tr>
<td>members</td><td></td></tr>
<tr>
<td>member_id</td><td></td></tr>
<tr>
<td>member_metadata</td><td></td></tr>
</table>
</p>
<h5>Heartbeat API (Key: 12):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">Heartbeat Request (Version: 0) => group_id group_generation_id member_id
group_id => STRING
group_generation_id => INT32
member_id => STRING
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td>The group id.</td></tr>
<tr>
<td>group_generation_id</td><td>The generation of the group.</td></tr>
<tr>
<td>member_id</td><td>The member id assigned by the group coordinator.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">Heartbeat Response (Version: 0) => error_code
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td></td></tr>
</table>
</p>
<h5>LeaveGroup API (Key: 13):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">LeaveGroup Request (Version: 0) => group_id member_id
group_id => STRING
member_id => STRING
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td>The group id.</td></tr>
<tr>
<td>member_id</td><td>The member id assigned by the group coordinator.</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">LeaveGroup Response (Version: 0) => error_code
error_code => INT16
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td></td></tr>
</table>
</p>
<h5>SyncGroup API (Key: 14):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">SyncGroup Request (Version: 0) => group_id generation_id member_id [group_assignment]
group_id => STRING
generation_id => INT32
member_id => STRING
group_assignment => member_id member_assignment
member_id => STRING
member_assignment => BYTES
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_id</td><td></td></tr>
<tr>
<td>generation_id</td><td></td></tr>
<tr>
<td>member_id</td><td></td></tr>
<tr>
<td>group_assignment</td><td></td></tr>
<tr>
<td>member_id</td><td></td></tr>
<tr>
<td>member_assignment</td><td></td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">SyncGroup Response (Version: 0) => error_code member_assignment
error_code => INT16
member_assignment => BYTES
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td></td></tr>
<tr>
<td>member_assignment</td><td></td></tr>
</table>
</p>
<h5>DescribeGroups API (Key: 15):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">DescribeGroups Request (Version: 0) => [group_ids]
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>group_ids</td><td>List of groupIds to request metadata for (an empty groupId array will return empty group metadata).</td></tr>
</table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">DescribeGroups Response (Version: 0) => [groups]
groups => error_code group_id state protocol_type protocol [members]
error_code => INT16
group_id => STRING
state => STRING
protocol_type => STRING
protocol => STRING
members => member_id client_id client_host member_metadata member_assignment
member_id => STRING
client_id => STRING
client_host => STRING
member_metadata => BYTES
member_assignment => BYTES
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>groups</td><td></td></tr>
<tr>
<td>error_code</td><td></td></tr>
<tr>
<td>group_id</td><td></td></tr>
<tr>
<td>state</td><td>The current state of the group (one of: Dead, Stable, AwaitingSync, or PreparingRebalance, or empty if there is no active group)</td></tr>
<tr>
<td>protocol_type</td><td>The current group protocol type (will be empty if the there is no active group)</td></tr>
<tr>
<td>protocol</td><td>The current group protocol (only provided if the group is Stable)</td></tr>
<tr>
<td>members</td><td>Current group members (only provided if the group is not Dead)</td></tr>
<tr>
<td>member_id</td><td>The memberId assigned by the coordinator</td></tr>
<tr>
<td>client_id</td><td>The client id used in the member's latest join group request</td></tr>
<tr>
<td>client_host</td><td>The client host used in the request session corresponding to the member's join group.</td></tr>
<tr>
<td>member_metadata</td><td>The metadata corresponding to the current group protocol in use (will only be present if the group is stable).</td></tr>
<tr>
<td>member_assignment</td><td>The current assignment provided by the group leader (will only be present if the group is stable).</td></tr>
</table>
</p>
<h5>ListGroups API (Key: 16):</h5>
<b>Requests:</b><br>
<p><pre class="line-numbers"><code class="language-java">ListGroups Request (Version: 0) =>
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr></table>
</p>
<b>Responses:</b><br>
<p><pre class="line-numbers"><code class="language-java">ListGroups Response (Version: 0) => error_code [groups]
error_code => INT16
groups => group_id protocol_type
group_id => STRING
protocol_type => STRING
</code></pre><table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>error_code</td><td></td></tr>
<tr>
<td>groups</td><td></td></tr>
<tr>
<td>group_id</td><td></td></tr>
<tr>
<td>protocol_type</td><td></td></tr>
</table>
</p>