Skip to content

Commit 5dd7bba

Browse files
author
Peter Cornelius
committed
Add back the default schemas in the producer example
1 parent e2786c2 commit 5dd7bba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ key_schema = avro.loads(key_schema_str)
105105
value = {"name": "Value"}
106106
key = {"name": "Key"}
107107

108-
avroProducer = AvroProducer({'bootstrap.servers': 'mybroker,mybroker2', 'schema.registry.url': 'http://schema_registry_host:port'})
109-
avroProducer.produce(topic='my-topic', value=value, key=key, value_schema=value_schema, key_schema=key_schema)
108+
avroProducer = AvroProducer({'bootstrap.servers': 'mybroker,mybroker2', 'schema.registry.url': 'http://schem_registry_host:port'}, default_key_schema=key_schema, default_value_schema=value_schema)
109+
avroProducer.produce(topic='my_topic', value=value, key=key)
110110
avroProducer.flush()
111111
```
112112

@@ -118,7 +118,7 @@ from confluent_kafka.avro import AvroConsumer
118118
from confluent_kafka.avro.serializer import SerializerError
119119

120120
c = AvroConsumer({'bootstrap.servers': 'mybroker,mybroker2', 'group.id': 'groupid', 'schema.registry.url': 'http://127.0.0.1:8081'})
121-
c.subscribe(['my-topic'])
121+
c.subscribe(['my_topic'])
122122
running = True
123123
while running:
124124
try:

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