Skip to content

Commit 4bdaa42

Browse files
authored
docs: Updates to changelog; align README and docs/index.rst (#3043)
1 parent ce5211e commit 4bdaa42

5 files changed

Lines changed: 116 additions & 75 deletions

File tree

CHANGES.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ This is a major release with significant changes to kafka-python internals to si
1111
* KIP-679: Update Producer defaults -- enable_idempotence=True, acks='all' (#3013)
1212
* KIP-735: Increase default consumer session_timeout_ms from 10s to 45s (#3030)
1313
* Rename api_version_auto_timeout_ms -> bootstrap_timeout_ms; default 30s (#3028)
14+
* Producer: Remove deprecation warning for buffer_memory config (now raises) (#3047)
15+
16+
### Abstract Interface Changes
17+
* Serializer/Deserializer: Pass headers to serialize/deserialize (#3046)
18+
* Partitioner: pass both key/value, serialized and unserialized, to partition() (#3045)
1419

1520
### Admin API Changes
1621
* Admin: change response shapes to simple dicts (#2883)
@@ -25,6 +30,7 @@ This is a major release with significant changes to kafka-python internals to si
2530
* Make IncompatibleBrokerVersion a subclass of UnsupportedVersionError (#2924)
2631
* Eliminate NoBrokersAvailableError (#2942)
2732
* KafkaProtocolError is not retriable (#2941)
33+
* Prefer raised Exceptions to assert / AssertionError (#3042)
2834

2935
### Old Networking Stack Removal
3036
* Remove kafka.client_async / kafka.conn legacy modules (#2918)
@@ -42,6 +48,7 @@ Complete refactor of the networking layer using a bespoke event-loop supporting
4248
* kafka.net.manager: Add call_soon(coro) and run(coro) for sync/async bridge (#2862)
4349
* kafka.net.manager: Bootstrap is sync/blocking (#2919)
4450
* connection: short-circuit send/recv when closed (#2967)
51+
* Clamp broker_version to user-supplied api_version (#3052)
4552

4653
### Transports and Proxies
4754
* Default SSLContext -> PROTOCOL_TLS_CLIENT; minimum version TLS 1.2 (#2807)
@@ -72,20 +79,20 @@ Defensive checks throughout the kafka.net event loop and transport stack: improv
7279
* kafka.net.selector: Use threading.Lock() to detect concurrent access to poll() (#2945)
7380
* kafka.net.selector: Track pending tasks to prevent gc before completion (#2950)
7481
* kafka.net.selector: Support reschedule(when, task); idempotent unschedule (#2939)
75-
* kafka.net: Raise RuntimeError on concurrent access to net.poll or wakeup() (#2938)
76-
* kafka.net: Raise RuntimeError on run/call_at/call_soon_threadsafe after closed (#2971)
77-
* kafka.net: Catch unhandled exceptions in IO thread (#2970)
78-
* kafka.net: Improve error handling on sock read/write (#2995)
82+
* kafka.net.selector: Raise RuntimeError on concurrent access to net.poll or wakeup() (#2938)
83+
* kafka.net.selector: Raise RuntimeError on run/call_at/call_soon_threadsafe after closed (#2971)
84+
* kafka.net.selector: Catch unhandled exceptions in IO thread (#2970)
85+
* kafka.net.selector: Improve error handling on sock read/write (#2995)
86+
* kafka.net.selector: Check locks in `_poll_once`; add net.drain() (#2949)
7987
* kafka.net.transport: Close connection on socket write error (#2973)
80-
* kafka.net: Check locks in _poll_once; add net.drain() (#2949)
8188

8289
## Protocol
8390

8491
A new JSON-schema-based dynamic protocol generator now replaces the legacy hand-written protocol classes (moved to `kafka.protocol.old`).
8592

8693
### Dynamic Protocol Classes
8794
Protocol classes are now generated from the upstream Apache Kafka JSON schemas.
88-
* Dynamic protocol classes using upstream json schemas (#2727, #2745, #2779, #2782, #2787, #2810)
95+
* Dynamic protocol classes using upstream json schemas (#2727, #2745, #2779, #2782, #2787, #2810, #3037)
8996
* Add .pyi type annotation stubs for generated protocol classes (#2784)
9097
* Migrate all internal usage to new protocol classes (#2764, #2765, #2766, #2767, #2768, #2772)
9198
* Refactor treatment of versioned ApiMessage classes (#2739)
@@ -117,6 +124,7 @@ Protocol classes are now generated from the upstream Apache Kafka JSON schemas.
117124
* Store in-flight request headers only for protocol parser (#2723)
118125
* Debug log send/recv bytes from protocol parser (#2707)
119126
* Adjust protocol debug logging; add KAFKA_PYTHON_PROTOCOL_DEBUG_LOG (#2719)
127+
* CoordinatorType enum (GROUP/TRANSACTION/SHARE) (#3049)
120128

121129
## Broker Version Check
122130

@@ -153,6 +161,7 @@ All consumer network I/O now flows through the shared kafka.net IO thread; `cons
153161
* Consumer: use background thread for all network io; drop HeartbeatThread (#2965)
154162
* Consumer: send all requests from net io thread (#2980)
155163
* Consumer: simplify poll() with fetcher.fetch_records (#2960)
164+
* Consumer: sleep in poll() if timeout, no records, and no fetchable partitions (#3039)
156165
* Consumer: drop poll loop optimizations for pending offset resets and rejoins (#2959)
157166
* Consumer: `_update_fetch_positions` -> `_refresh_committed_offsets`; dont poll in position() (#2958)
158167
* Consumer: convert fetcher reset_offsets/send_list_offsets_requests to async def
@@ -227,16 +236,16 @@ Split KafkaAdminClient into focused mixin classes (cluster, topics, configs, gro
227236
### Refactor and Async Migration
228237
The admin client interface remains sync but wraps a fully-async internal api (does not support asyncio yet). Adds cached coordinator lookups and a mixin structure to separate logical resource groups.
229238
* Admin: split into functional mixin classes (#2873, #2877, #2882)
230-
* Admin: convert request paths to async; cache coordinator_ids (#2851, #2862, #2863, #2866, #2867, #2870, #2871)
239+
* Admin: convert request paths to async; cache coordinator_ids (#2851, #2862, #2863, #2866, #2867, #2870, #2871, #3050)
231240
* Admin: refactor `_send_request_to_controller` error handling (#2751)
232241

233-
### KIP Support
242+
### Batch Protocol Support
234243
* KIP-699: FindCoordinatorRequest v4 -- multi-group support (#3025)
235244
* KIP-709: OffsetFetch v8 -- use batch interface when available (#3024)
236245

237246
### New Cluster and Quorum APIs
238247
* Admin: describe_metadata_quorum (#2914)
239-
* Admin: cluster features describe/update (#2908)
248+
* Admin: cluster features describe/update (#2908, #3053)
240249
* Admin: cluster get_broker_version_data / api_versions (#2903)
241250

242251
### Configs
@@ -252,13 +261,15 @@ The admin client interface remains sync but wraps a fully-async internal api (do
252261
* Admin: Expand partitions api support (#2890)
253262
* Admin: Cleanup alter_partition_reassignments (#3002)
254263

255-
256264
### Groups
257265
* Admin: include latest offsets and lag in list_group_offsets; add reset_group_offsets (#2897)
258266
* Admin: support group state/type filters for list_groups (#2910)
259267
* Admin: add extended group reset options (#2911)
260268
* Admin: Dont return MemberToRemove as key in remove_group_members dict result (#2893)
261269

270+
### Transactions
271+
* Admin: implement KIP-664 hanging-transaction tooling (#3051)
272+
262273
### Log Dirs
263274
* Admin: alter_log_dirs (#2912)
264275
* Admin: Fix describe_log_dirs, accept optional topics/brokers (#2881)
@@ -286,13 +297,18 @@ The CLI adds shared parser config, SASL/SSL connection support across all subcom
286297
* admin cli: catch AttributeError and print_help() (#2880)
287298
* admin cli: fix describe_configs (#2875)
288299

300+
### Consumer CLI
301+
* consumer cli does not require group_id (#3044)
302+
289303
## Compatibility / Misc
290304

291305
Small quality-of-life additions to the public API surface.
292306

293307
* Support context manager interface for consumer/producer/admin (#2969)
294308
* Make IncompatibleBrokerVersion a subclass of UnsupportedVersionError (#2924)
295309
* Add OffsetSpec / IsolationLevel to kafka imports (#2898)
310+
* Errors: subclasses for RetriableError and InvalidMetadataError (#3041)
311+
* Helper classes: DefaultSerializer and JsonSerializer (#3046)
296312

297313
## Fixes
298314

README.rst

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
Kafka Python client
2-
------------------------
1+
kafka-python
2+
############
33

4+
.. image:: https://img.shields.io/pypi/v/kafka-python.svg
5+
:target: https://pypi.org/project/kafka-python
46
.. image:: https://img.shields.io/badge/kafka-4.3--0.8-brightgreen.svg
57
:target: https://kafka-python.readthedocs.io/en/master/compatibility.html
6-
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
7-
:target: https://pypi.python.org/pypi/kafka-python
8+
89
.. image:: https://img.shields.io/badge/license-Apache%202-blue.svg
910
:target: https://github.com/dpkp/kafka-python/blob/master/LICENSE
10-
.. image:: https://img.shields.io/pypi/dw/kafka-python.svg
11-
:target: https://pypistats.org/packages/kafka-python
12-
.. image:: https://img.shields.io/pypi/v/kafka-python.svg
13-
:target: https://pypi.org/project/kafka-python
14-
.. image:: https://img.shields.io/pypi/implementation/kafka-python
15-
:target: https://github.com/dpkp/kafka-python/blob/master/pyproject.toml
16-
11+
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
12+
:target: https://pypi.python.org/pypi/kafka-python
1713

1814

1915
kafka-python is a pure-python client library for Apache Kafka, the distributed
@@ -23,21 +19,28 @@ to manage.
2319

2420
kafka-python can also be used as a simple alternative to the apache kafka admin
2521
scripts, which require an installed/compatible jvm. A simple CLI interface for
26-
admin commands is provided as `kafka-python admin` / `python -m kafka.admin`.
22+
admin commands is provided as ``kafka-python admin`` / ``python -m kafka.admin``.
2723

28-
Users looking to add more raw throughput can pip install `crc32c` as
24+
Users looking to add more raw throughput can ``pip install crc32c`` as
2925
an optional dependency, offloading one of the most CPU intensive subsystems
3026
to an optimized C library.
3127

3228

3329
.. code-block:: bash
3430
3531
pip install kafka-python
32+
3633
# callable as module or as cli-script
3734
kafka-python admin -b localhost:9092 cluster describe
35+
36+
# Create a topic with the admin cli
3837
python -m kafka.admin -b localhost:9092 topics create -t foo-topic
38+
39+
# Produce messages
3940
echo "foo message" | python -m kafka.producer -b localhost:9092 -t foo-topic
40-
python -m kafka.consumer -b localhost:9092 -C auto_offset_reset=earliest -g foo-group -t foo-topic
41+
42+
# Consume messages
43+
python -m kafka.consumer -b localhost:9092 -C auto_offset_reset=earliest -C consumer_timeout_ms=1000 -g foo-group -t foo-topic
4144
4245
4346
What's New in 3.0

docs/changelog.rst

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ Default Configuration Changes
1818
* KIP-679: Update Producer defaults -- enable_idempotence=True, acks='all' (#3013)
1919
* KIP-735: Increase default consumer session_timeout_ms from 10s to 45s (#3030)
2020
* Rename api_version_auto_timeout_ms -> bootstrap_timeout_ms; default 30s (#3028)
21+
* Producer: Remove deprecation warning for buffer_memory config (now raises) (#3047)
22+
23+
Abstract Interface Changes
24+
^^^^^^^^^^^^^^^^^^^^^^^^^^
25+
* Serializer/Deserializer: Pass headers to serialize/deserialize (#3046)
26+
* Partitioner: pass both key/value, serialized and unserialized, to partition() (#3045)
2127

2228
Admin API Changes
2329
^^^^^^^^^^^^^^^^^
@@ -35,6 +41,7 @@ Error Hierarchy
3541
* Make IncompatibleBrokerVersion a subclass of UnsupportedVersionError (#2924)
3642
* Eliminate NoBrokersAvailableError (#2942)
3743
* KafkaProtocolError is not retriable (#2941)
44+
* Prefer raised Exceptions to assert / AssertionError (#3042)
3845

3946
Old Networking Stack Removal
4047
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -55,6 +62,7 @@ Async IO Substrate
5562
* kafka.net.manager: Add call_soon(coro) and run(coro) for sync/async bridge (#2862)
5663
* kafka.net.manager: Bootstrap is sync/blocking (#2919)
5764
* connection: short-circuit send/recv when closed (#2967)
65+
* Clamp broker_version to user-supplied api_version (#3052)
5866

5967
Transports and Proxies
6068
^^^^^^^^^^^^^^^^^^^^^^
@@ -93,12 +101,12 @@ Defensive checks throughout the kafka.net event loop and transport stack: improv
93101
* kafka.net.selector: Use threading.Lock() to detect concurrent access to poll() (#2945)
94102
* kafka.net.selector: Track pending tasks to prevent gc before completion (#2950)
95103
* kafka.net.selector: Support reschedule(when, task); idempotent unschedule (#2939)
96-
* kafka.net: Raise RuntimeError on concurrent access to net.poll or wakeup() (#2938)
97-
* kafka.net: Raise RuntimeError on run/call_at/call_soon_threadsafe after closed (#2971)
98-
* kafka.net: Catch unhandled exceptions in IO thread (#2970)
99-
* kafka.net: Improve error handling on sock read/write (#2995)
104+
* kafka.net.selector: Raise RuntimeError on concurrent access to net.poll or wakeup() (#2938)
105+
* kafka.net.selector: Raise RuntimeError on run/call_at/call_soon_threadsafe after closed (#2971)
106+
* kafka.net.selector: Catch unhandled exceptions in IO thread (#2970)
107+
* kafka.net.selector: Improve error handling on sock read/write (#2995)
108+
* kafka.net.selector: Check locks in _poll_once; add net.drain() (#2949)
100109
* kafka.net.transport: Close connection on socket write error (#2973)
101-
* kafka.net: Check locks in _poll_once; add net.drain() (#2949)
102110

103111
Protocol
104112
--------
@@ -109,7 +117,7 @@ Dynamic Protocol Classes
109117
^^^^^^^^^^^^^^^^^^^^^^^^
110118
Protocol classes are now generated from the upstream Apache Kafka JSON schemas.
111119

112-
* Dynamic protocol classes using upstream json schemas (#2727, #2745, #2779, #2782, #2787, #2810)
120+
* Dynamic protocol classes using upstream json schemas (#2727, #2745, #2779, #2782, #2787, #2810, #3037)
113121
* Add .pyi type annotation stubs for generated protocol classes (#2784)
114122
* Migrate all internal usage to new protocol classes (#2764, #2765, #2766, #2767, #2768, #2772)
115123
* Refactor treatment of versioned ApiMessage classes (#2739)
@@ -145,6 +153,7 @@ Helpers and Debugging
145153
* Store in-flight request headers only for protocol parser (#2723)
146154
* Debug log send/recv bytes from protocol parser (#2707)
147155
* Adjust protocol debug logging; add KAFKA_PYTHON_PROTOCOL_DEBUG_LOG (#2719)
156+
* CoordinatorType enum (GROUP/TRANSACTION/SHARE) (#3049)
148157

149158
Broker Version Check
150159
--------------------
@@ -188,6 +197,7 @@ All consumer network I/O now flows through the shared IO thread; ``poll()`` no l
188197
* Consumer: use background thread for all network io; drop HeartbeatThread (#2965)
189198
* Consumer: send all requests from net io thread (#2980)
190199
* Consumer: simplify poll() with fetcher.fetch_records (#2960)
200+
* Consumer: sleep in poll() if timeout, no records, and no fetchable partitions (#3039)
191201
* Consumer: drop poll loop optimizations for pending offset resets and rejoins (#2959)
192202
* Consumer: _update_fetch_positions -> _refresh_committed_offsets; dont poll in position() (#2958)
193203
* Consumer: convert fetcher reset_offsets/send_list_offsets_requests to async def
@@ -276,18 +286,18 @@ Refactor and Async Migration
276286
The admin client interface remains sync but wraps a fully-async internal api (does not support asyncio yet). Adds cached coordinator lookups and a mixin structure to separate logical resource groups.
277287

278288
* Admin: split into functional mixin classes (#2873, #2877, #2882)
279-
* Admin: convert request paths to async; cache coordinator_ids (#2851, #2862, #2863, #2866, #2867, #2870, #2871)
289+
* Admin: convert request paths to async; cache coordinator_ids (#2851, #2862, #2863, #2866, #2867, #2870, #2871, #3050)
280290
* Admin: refactor `_send_request_to_controller` error handling (#2751)
281291

282-
KIP Support
283-
^^^^^^^^^^^
292+
Batch Protocol Support
293+
^^^^^^^^^^^^^^^^^^^^^^
284294
* KIP-699: FindCoordinatorRequest v4 -- multi-group support (#3025)
285295
* KIP-709: OffsetFetch v8 -- use batch interface when available (#3024)
286296

287297
New Cluster and Quorum APIs
288298
^^^^^^^^^^^^^^^^^^^^^^^^^^^
289299
* Admin: describe_metadata_quorum (#2914)
290-
* Admin: cluster features describe/update (#2908)
300+
* Admin: cluster features describe/update (#2908, #3053)
291301
* Admin: cluster get_broker_version_data / api_versions (#2903)
292302

293303
Configs
@@ -312,6 +322,10 @@ Groups
312322
* Admin: add extended group reset options (#2911)
313323
* Admin: Dont return MemberToRemove as key in remove_group_members dict result (#2893)
314324

325+
Transactions
326+
^^^^^^^^^^^^
327+
* Admin: implement KIP-664 hanging-transaction tooling (#3051)
328+
315329
Log Dirs
316330
^^^^^^^^
317331
* Admin: alter_log_dirs (#2912)
@@ -344,6 +358,10 @@ Admin CLI
344358
* admin cli: catch AttributeError and print_help() (#2880)
345359
* admin cli: fix describe_configs (#2875)
346360

361+
Consumer CLI
362+
^^^^^^^^^^^^
363+
* consumer cli does not require group_id (#3044)
364+
347365
Compatibility / Misc
348366
--------------------
349367

@@ -352,6 +370,8 @@ Small quality-of-life additions to the public API surface.
352370
* Support context manager interface for consumer/producer/admin (#2969)
353371
* Make IncompatibleBrokerVersion a subclass of UnsupportedVersionError (#2924)
354372
* Add OffsetSpec / IsolationLevel to kafka imports (#2898)
373+
* Errors: subclasses for RetriableError and InvalidMetadataError (#3041)
374+
* Helper classes: DefaultSerializer and JsonSerializer (#3046)
355375

356376
Fixes
357377
-----

0 commit comments

Comments
 (0)