Skip to content

Commit 94a0c36

Browse files
author
Peter Cornelius
committed
Pass the schemas in with the call to produce to demonstrate the
flexibility of the parameters.
1 parent 0376db2 commit 94a0c36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ key_schema = avro.load('KeySchema.avsc')
7676
value = {"name": "Value"}
7777
key = {"name": "Key"}
7878

79-
avroProducer = AvroProducer({'bootstrap.servers': 'mybroker,mybroker2', 'schema.registry.url': 'http://schem_registry_host:port'}, default_key_schema=key_schema, default_value_schema=value_schema)
80-
avroProducer.produce(topic='my-topic', value=value, key=key)
79+
avroProducer = AvroProducer({'bootstrap.servers': 'mybroker,mybroker2', 'schema.registry.url': 'http://schem_registry_host:port'})
80+
avroProducer.produce(topic='my-topic', value=value, key=key, value_schema=value_schema, key_schema=key_schema)
8181
avroProducer.flush()
8282
```
8383

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