You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-65Lines changed: 1 addition & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,6 @@ Superstream Clients works as a Python import hook that intercepts Kafka producer
15
15
16
16
## Supported Libraries
17
17
18
-
Works with any Python library that implements Kafka producers, including:
19
-
20
18
- kafka-python
21
19
- aiokafka
22
20
- confluent-kafka
@@ -31,51 +29,6 @@ Works with any Python library that implements Kafka producers, including:
31
29
-**Dynamic configuration**: Applies optimized settings based on topic-specific recommendations
32
30
-**Intelligent optimization**: Identifies the most impactful topics to optimize
33
31
-**Graceful fallback**: Falls back to default settings if optimization fails
34
-
-**Minimal overhead**: Uses a single lightweight background thread (or async coroutine for aiokafka)
35
-
36
-
## Important: Producer Configuration Requirements
37
-
38
-
When initializing your Kafka producers, please ensure you pass the configuration as a mutable object. The Superstream library needs to modify the producer configuration to apply optimizations. The following initialization patterns are supported:
39
-
40
-
✅ **Supported (Recommended)**:
41
-
```python
42
-
# Using kafka-python
43
-
from kafka import KafkaProducer
44
-
producer = KafkaProducer(
45
-
bootstrap_servers=['localhost:9092'],
46
-
compression_type='snappy',
47
-
batch_size=16384
48
-
)
49
-
50
-
# Using aiokafka
51
-
from aiokafka import AIOKafkaProducer
52
-
producer = AIOKafkaProducer(
53
-
bootstrap_servers='localhost:9092',
54
-
compression_type='snappy',
55
-
batch_size=16384
56
-
)
57
-
58
-
# Using confluent-kafka
59
-
from confluent_kafka import Producer
60
-
producer = Producer({
61
-
'bootstrap.servers': 'localhost:9092',
62
-
'compression.type': 'snappy',
63
-
'batch.size': 16384
64
-
})
65
-
```
66
-
67
-
❌ **Not Supported**:
68
-
```python
69
-
# Using frozen dictionaries or immutable configurations
70
-
from types import MappingProxyType
71
-
config = MappingProxyType({
72
-
'bootstrap.servers': 'localhost:9092'
73
-
})
74
-
producer = KafkaProducer(**config)
75
-
```
76
-
77
-
### Why This Matters
78
-
The Superstream library needs to modify your producer's configuration to apply optimizations based on your cluster's characteristics. This includes adjusting settings like compression, batch size, and other performance parameters. When the configuration is immutable, these optimizations cannot be applied.
79
32
80
33
## Installation
81
34
@@ -87,24 +40,7 @@ That's it! Superclient will now automatically load and optimize all Kafka produc
87
40
88
41
## Usage
89
42
90
-
After installation, superclient works automatically. Just use your Kafka clients as usual:
0 commit comments