Skip to content

Instantly share code, notes, and snippets.

@chrisdone
Last active December 27, 2019 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdone/aae399c28dbe86dfef01abc21994abdd to your computer and use it in GitHub Desktop.
Save chrisdone/aae399c28dbe86dfef01abc21994abdd to your computer and use it in GitHub Desktop.
Build kafka docs

Available here:

https://hub.docker.com/r/chrisdone/kafka-doc-html/tags

Root directory contains:

ls
admin_client_config.html  consumer_metrics.html  producer_metrics.html   sink_connector_config.html
connect_config.html                              protocol_api_keys.html  source_connector_config.html
connect_metrics.html      kafka_config.html      protocol_errors.html    streams_config.html
connect_transforms.html   protocol_messages.html  topic_config.html
consumer_config.html      producer_config.html   protocol_types.html     

See below for example output.

FROM alpine@sha256:3983cc12fb9dc20a009340149e382a18de6a8261b0ac0e8f5fcdf11f8dd5937e as builder
RUN apk add --update gradle openjdk8-jre-base git curl && \
git clone https://github.com/apache/kafka.git && \
cd kafka && \
git checkout 2.4.0 && \
./gradlew genProtocolMessageDocs genProtocolApiKeyDocs genProtocolTypesDocs genProtocolErrorDocs
FROM scratch
COPY --from=builder /kafka/docs/generated /
<table class="data-table"><tbody>
<tr><th>Name</th>
<th>Key</th>
</tr><tr>
<td><a href="#The_Messages_Produce">Produce</a></td><td>0</td></tr>
<tr>
<td><a href="#The_Messages_Fetch">Fetch</a></td><td>1</td></tr>
<tr>
<td><a href="#The_Messages_ListOffsets">ListOffsets</a></td><td>2</td></tr>
<tr>
<td><a href="#The_Messages_Metadata">Metadata</a></td><td>3</td></tr>
<tr>
<td><a href="#The_Messages_LeaderAndIsr">LeaderAndIsr</a></td><td>4</td></tr>
<tr>
...
<table class="data-table"><tbody>
<tr><th>Error</th>
<th>Code</th>
<th>Retriable</th>
<th>Description</th>
</tr>
<tr><td>UNKNOWN_SERVER_ERROR</td><td>-1</td><td>False</td><td>The server experienced an unexpected error when processing the request.</td></tr>
<tr><td>NONE</td><td>0</td><td>False</td><td></td></tr>
<tr><td>OFFSET_OUT_OF_RANGE</td><td>1</td><td>False</td><td>The requested offset is not within the range of offsets maintained by the server.</td></tr>
<tr><td>CORRUPT_MESSAGE</td><td>2</td><td>True</td><td>This message has failed its CRC checksum, exceeds the valid size, has a null key for a compacted topic, or is otherwise corrupt.</td></tr>
<tr><td>UNKNOWN_TOPIC_OR_PARTITION</td><td>3</td><td>True</td><td>This server does not host this topic-partition.</td></tr>
<tr><td>INVALID_FETCH_SIZE</td><td>4</td><td>False</td><td>The requested fetch size is invalid.</td></tr>
<tr><td>LEADER_NOT_AVAILABLE</td><td>5</td><td>True</td><td>There is no leader for this topic-partition as we are in the middle of a leadership election.</td></tr>
<tr><td>NOT_LEADER_FOR_PARTITION</td><td>6</td><td>True</td><td>This server is not the leader for that topic-partition
....
<h5>Headers:</h5>
<pre>Request Header v0 => request_api_key request_api_version correlation_id
request_api_key => INT16
request_api_version => INT16
correlation_id => INT32
</pre>
<table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>request_api_key</td><td>The API key of this request.</td></tr>
<tr>
<td>request_api_version</td><td>The API version of this request.</td></tr>
<tr>
<td>correlation_id</td><td>The correlation ID of this request.</td></tr>
</table>
<pre>Request Header v1 => request_api_key request_api_version correlation_id client_id
request_api_key => INT16
request_api_version => INT16
correlation_id => INT32
client_id => NULLABLE_STRING
</pre>
<table class="data-table"><tbody>
<tr><th>Field</th>
<th>Description</th>
</tr><tr>
<td>request_api_key</td><td>The API key of this request.</td></tr>
<tr>
<td>request_api_version</td><td>The API version of this request.</td></tr>
<tr>
<td>correlation_id</td><td>The correlation ID of this request.</td></tr>
<tr>
<td>client_id</td><td>The client ID string.</td></tr>
</table>
<pre>Request Header v2 => request_api_key request_api_version correlation_id client_id TAG_BUFFER
request_api_key => INT16
request_api_version => INT16
correlation_id => INT32
client_id => NULLABLE_STRING
</pre>
<table class="data-table"><tbody>
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment