1
1
Kafka Python client
2
2
------------------------
3
3
4
- .. image :: https://img.shields.io/badge/kafka-2.5%2C%202.4%2C%202.3%2C%202.2%2C%202.1%2C%202.0%2C%201.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
4
+ .. image :: https://img.shields.io/badge/kafka-2.6%2C%202. 5%2C%202.4%2C%202.3%2C%202.2%2C%202.1%2C%202.0%2C%201.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
5
5
:target: https://kafka-python.readthedocs.io/en/master/compatibility.html
6
6
.. image :: https://img.shields.io/pypi/pyversions/kafka-python.svg
7
7
:target: https://pypi.python.org/pypi/kafka-python
@@ -34,6 +34,7 @@ documentation, please see readthedocs and/or python's inline help.
34
34
35
35
>>> pip install kafka- python
36
36
37
+
37
38
KafkaConsumer
38
39
*************
39
40
@@ -78,6 +79,7 @@ that expose basic message attributes: topic, partition, offset, key, and value:
78
79
>>> # Get consumer metrics
79
80
>>> metrics = consumer.metrics()
80
81
82
+
81
83
KafkaProducer
82
84
*************
83
85
@@ -124,6 +126,7 @@ for more details.
124
126
>>> # Get producer performance metrics
125
127
>>> metrics = producer.metrics()
126
128
129
+
127
130
Thread safety
128
131
*************
129
132
@@ -133,22 +136,30 @@ KafkaConsumer which cannot.
133
136
While it is possible to use the KafkaConsumer in a thread-local manner,
134
137
multiprocessing is recommended.
135
138
139
+
136
140
Compression
137
141
***********
138
142
139
- kafka-python supports gzip compression/decompression natively. To produce or consume lz4
140
- compressed messages, you should install python-lz4 (pip install lz4).
141
- To enable snappy compression/decompression install python-snappy (also requires snappy library).
142
- See <https://kafka-python.readthedocs.io/en/master/install.html#optional-snappy-install>
143
- for more information.
143
+ kafka-python supports the following compression formats:
144
+
145
+ - gzip
146
+ - LZ4
147
+ - Snappy
148
+ - Zstandard (zstd)
149
+
150
+ gzip is supported natively, the others require installing additional libraries.
151
+ See <https://kafka-python.readthedocs.io/en/master/install.html> for more information.
152
+
144
153
145
154
Optimized CRC32 Validation
146
155
**************************
147
156
148
157
Kafka uses CRC32 checksums to validate messages. kafka-python includes a pure
149
158
python implementation for compatibility. To improve performance for high-throughput
150
159
applications, kafka-python will use `crc32c ` for optimized native code if installed.
151
- See https://pypi.org/project/crc32c/
160
+ See <https://kafka-python.readthedocs.io/en/master/install.html> for installation instructions.
161
+ See https://pypi.org/project/crc32c/ for details on the underlying crc32c lib.
162
+
152
163
153
164
Protocol
154
165
********
@@ -158,4 +169,4 @@ for interacting with kafka brokers via the python repl. This is useful for
158
169
testing, probing, and general experimentation. The protocol support is
159
170
leveraged to enable a KafkaClient.check_version() method that
160
171
probes a kafka broker and attempts to identify which version it is running
161
- (0.8.0 to 2.4 +).
172
+ (0.8.0 to 2.6 +).
0 commit comments