Skip to content

Commit 0723cf8

Browse files
committed
Better examples in README
1 parent d3cf18a commit 0723cf8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ from kafka.partitioner import HashedPartitioner, RoundRobinPartitioner
4949

5050
kafka = KafkaClient("localhost", 9092)
5151

52-
producer = KeyedProducer(kafka, "my-topic", partitioner=HashedPartitioner)
52+
# HashedPartitioner is default
53+
producer = KeyedProducer(kafka, "my-topic")
5354
producer.send("key1", "some message")
5455
producer.send("key2", "this methode")
56+
57+
producer = KeyedProducer(kafka, "my-topic", partitioner=RoundRobinPartitioner)
5558
```
5659

5760
## Low level

0 commit comments

Comments
 (0)