Skip to content

Commit 7b9a95a

Browse files
rnpridgeonRyan P
authored andcommitted
Update JSON/Avro consumer examples to include consumer.close()
1 parent d945720 commit 7b9a95a

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

examples/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ The scripts in this directory provide code examples using Confluent's Python cli
55
* [consumer.py](consumer.py): reads messages from a Kafka topic
66
* [producer.py](producer.py): reads lines from stdin and sends them to Kafka
77
* [eos-transactions.py](eos-transactions.py): transactional producer with exactly once semantics (EOS)
8+
* [avro_producer.py](avro_producer.py): SerializingProducer with AvroSerializer
9+
* [avro_consumer.py](avro_consumer.py): DeserializingConsumer with AvroDeserializer
10+
* [json_producer.py](json_producer.py): SerializingProducer with JsonSerializer
11+
* [json_consumer.py](json_consumer.py): DeserializingConsumer with JsonDeserializer
12+
* [protobuf_producer.py](protobuf_producer.py): SerializingProducer with ProtobufSerializer
13+
* [protobuf_consumer.py](protobuf_consumer.py): DeserializingConsumer with ProtobufDeserializer
814

915
Additional examples for [Confluent Cloud](https://www.confluent.io/confluent-cloud/):
1016

examples/avro_consumer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ def main(args):
113113
except KeyboardInterrupt:
114114
break
115115

116+
consumer.close()
117+
116118

117119
if __name__ == '__main__':
118120
parser = argparse.ArgumentParser(description="Consumer Example client with "

examples/json_consumer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ def main(args):
121121
except KeyboardInterrupt:
122122
break
123123

124+
consumer.close()
125+
124126

125127
if __name__ == '__main__':
126128
parser = argparse.ArgumentParser(description="DeserializingConsumer Example")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy