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
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,13 @@ Confluent's Python Client for Apache Kafka<sup>TM</sup>
3
3
4
4
**confluent-kafka-python** is Confluent's Python client for [Apache Kafka](http://kafka.apache.org/) and the
5
5
[Confluent Platform](https://www.confluent.io/product/compare/). It provides a high-level Producer, Consumer
6
-
and AdminClient analogous to the Java client which are backwards and forwards compatible with all
7
-
Kafka brokers from version 0.8.
6
+
and AdminClient which are backwards and forwards compatible with all Kafka brokers from version 0.8.
8
7
9
8
Characteristics:
10
9
11
10
-**Reliable** - The Python client is a wrapper around [librdkafka](https://github.com/edenhill/librdkafka) (provided automatically via binary wheels) which is widely deployed in a diverse set of production scenarios. It's tested using [the same set of system tests](https://github.com/confluentinc/confluent-kafka-python/tree/master/confluent_kafka/kafkatest) as the Java client [and more](https://github.com/confluentinc/confluent-kafka-python/tree/master/tests). It's supported by [Confluent](https://confluent.io).
12
11
13
-
-**Performant** - Performance is a key design consideration. Latency is on par with the Java client, as is maximum throughput for larger message sizes (where the overhead of the Python interpreter has less impact).
12
+
-**Performant** - Performance is a key design consideration. Maximum throughput is on par with the Java clientfor larger message sizes (where the overhead of the Python interpreter has less impact). Latency is on par with the Java client.
14
13
15
14
-**Future proof** - Confluent, founded by the
16
15
creators of Kafka, is building a [streaming platform](https://www.confluent.io/product/compare/)
@@ -29,7 +28,7 @@ Usage
29
28
Below are some examples of typical usage. For more examples, including [how to configure](examples/confluent_cloud.py) the python client for use with
30
29
[Confluent Cloud](https://www.confluent.io/confluent-cloud/), see the [examples](examples) directory.
31
30
32
-
**Producer:**
31
+
**Producer**
33
32
34
33
```python
35
34
from confluent_kafka import Producer
@@ -60,7 +59,7 @@ p.flush()
60
59
```
61
60
62
61
63
-
**High-level Consumer:**
62
+
**High-level Consumer**
64
63
65
64
```python
66
65
from confluent_kafka import Consumer, KafkaError
@@ -182,7 +181,9 @@ from confluent_kafka.admin import AdminClient, NewTopic
182
181
a = AdminClient({'bootstrap.servers': 'mybroker'})
183
182
184
183
new_topics = [NewTopic(topic, num_partitions=3, replication_factor=1) for topic in ["topic1", "topic2"]]
185
-
# Call create_topics to asynchronously create topics, a dict
184
+
# Note: In a multi-cluster production scenario, it is more typical to use a replication_factor of 3 for durability.
185
+
186
+
# Call create_topics to asynchronously create topics. A dict
186
187
# of <topic,future> is returned.
187
188
fs = a.create_topics(new_topics)
188
189
@@ -212,11 +213,11 @@ Install
212
213
confluent-kafka using the command in the "Install from
213
214
source from PyPi" section below.
214
215
215
-
**Install self-contained binary wheels for OSX and Linux from PyPi:**
216
+
**Install self-contained binary wheels for OSX and Linux from PyPi**
216
217
217
218
$ pip install confluent-kafka
218
219
219
-
**Install AvroProducer and AvroConsumer:**
220
+
**Install AvroProducer and AvroConsumer**
220
221
221
222
$ pip install "confluent-kafka[avro]"
222
223
@@ -283,7 +284,7 @@ Tests
283
284
=====
284
285
285
286
286
-
**Run unit-tests:**
287
+
**Run unit-tests**
287
288
288
289
In order to run full test suite, simply execute:
289
290
@@ -292,7 +293,7 @@ In order to run full test suite, simply execute:
292
293
**NOTE**: Requires `tox` (please install with `pip install tox`), several supported versions of Python on your path, and `librdkafka`[installed](tools/bootstrap-librdkafka.sh) into `tmp-build`.
293
294
294
295
295
-
**Integration tests:**
296
+
**Integration tests**
296
297
297
298
See [tests/README.md](tests/README.md) for instructions on how to run integration tests.
0 commit comments