File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
The scripts in this directory provide code examples using Confluent's Python client:
2
2
3
3
* [ adminapi.py] ( adminapi.py ) : collection of Kafka Admin API operations
4
+ * [ asyncio_example.py] ( asyncio_example.py ) : AsyncIO webserver with Kafka producer
4
5
* [ avro-cli.py] ( avro-cli.py ) : produces Avro messages with Confluent Schema Registry and then reads them back again
5
6
* [ consumer.py] ( consumer.py ) : reads messages from a Kafka topic
6
7
* [ producer.py] ( producer.py ) : reads lines from stdin and sends them to Kafka
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+
1
3
# flake8: noqa
2
4
# Copyright 2019 Confluent Inc.
3
5
#
13
15
# See the License for the specific language governing permissions and
14
16
# limitations under the License.
15
17
18
+
16
19
# Companion code to the blog post "Integrating Kafka With Python
17
20
# Asyncio Web Applications"
18
21
# https://www.confluent.io/blog/kafka-python-asyncio-integration/
19
-
22
+ #
20
23
# Example Siege [https://github.com/JoeDog/siege] test:
21
24
# $ siege -c 400 -r 200 'http://localhost:8000/items1 POST {"name":"testuser"}'
22
25
26
+
23
27
import asyncio
24
28
import confluent_kafka
25
29
from confluent_kafka import KafkaException
You can’t perform that action at this time.
0 commit comments