Skip to content

Commit 98af46d

Browse files
aranaeaedenhill
authored andcommitted
Avro example update in README (#274, @aranaea)
1 parent d395b73 commit 98af46d

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,36 @@ from confluent_kafka import avro
8787
from confluent_kafka.avro import AvroProducer
8888

8989

90-
value_schema = avro.load('ValueSchema.avsc')
91-
key_schema = avro.load('KeySchema.avsc')
90+
value_schema_str = """
91+
{
92+
"namespace": "my.test",
93+
"name": "value",
94+
"type": "record",
95+
"fields" : [
96+
{
97+
"name" : "name",
98+
"type" : "string"
99+
}
100+
]
101+
}
102+
"""
103+
104+
key_schema_str = """
105+
{
106+
"namespace": "my.test",
107+
"name": "key",
108+
"type": "record",
109+
"fields" : [
110+
{
111+
"name" : "name",
112+
"type" : "string"
113+
}
114+
]
115+
}
116+
"""
117+
118+
value_schema = avro.loads(value_schema_str)
119+
key_schema = avro.loads(key_schema_str)
92120
value = {"name": "Value"}
93121
key = {"name": "Key"}
94122

0 commit comments

Comments
 (0)