@@ -16,6 +16,25 @@ This project is very much alpha. The API is in flux and not all the features are
16
16
17
17
Install with your favorite package manager
18
18
19
+ Pip:
20
+
21
+ ``` shell
22
+ git clone https://github.com/mumrah/kafka-python
23
+ pip install kafka-python
24
+ ```
25
+
26
+ Setuptools:
27
+ ``` shell
28
+ git clone https://github.com/mumrah/kafka-python
29
+ easy_install kafka-python
30
+ ```
31
+
32
+ Using ` setup.py ` directly:
33
+ ``` shell
34
+ git clone https://github.com/mumrah/kafka-python
35
+ python setup.py install
36
+ ```
37
+
19
38
# Tests
20
39
21
40
## Run the unit tests
@@ -55,7 +74,7 @@ python -m test.integration
55
74
56
75
## Send several messages to a topic
57
76
58
- Same as before, just add more arguments to ` send_simple `
77
+ Same as before, just add more arguments to ` send\_simple `
59
78
60
79
``` python
61
80
kafka = KafkaClient(" localhost" , 9092 )
@@ -65,7 +84,7 @@ Same as before, just add more arguments to `send_simple`
65
84
66
85
## Recieve some messages from a topic
67
86
68
- Supply ` get_message_set ` with a ` FetchRequest ` , get back the messages and new ` FetchRequest `
87
+ Supply ` get\_message\_set ` with a ` FetchRequest ` , get back the messages and new ` FetchRequest `
69
88
70
89
``` python
71
90
kafka = KafkaClient(" localhost" , 9092 )
@@ -79,7 +98,7 @@ paging through the queue very simple.
79
98
80
99
## Send multiple messages to multiple topics
81
100
82
- For this we use the ` send_multi_message_set ` method along with ` ProduceRequest ` objects.
101
+ For this we use the ` send\_multi\_message\_set ` method along with ` ProduceRequest ` objects.
83
102
84
103
``` python
85
104
kafka = KafkaClient(" localhost" , 9092 )
@@ -97,7 +116,7 @@ For this we use the `send_multi_message_set` method along with `ProduceRequest`
97
116
98
117
## Iterate through all messages from an offset
99
118
100
- The ` iter_messages ` method will make the underlying calls to ` get_message_set `
119
+ The ` iter\_messages ` method will make the underlying calls to ` get\_message\_set `
101
120
to provide a generator that returns every message available.
102
121
103
122
``` python
@@ -116,5 +135,4 @@ An optional `auto` argument will control auto-paging through results
116
135
kafka.close()
117
136
```
118
137
119
- This will only iterate through messages in the byte range of
120
- (0, 1024\* 1024)
138
+ This will only iterate through messages in the byte range of (0, 1024\* 1024)
0 commit comments