File tree Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,37 @@ c.close()
71
71
from confluent_kafka import avro
72
72
from confluent_kafka.avro import AvroProducer
73
73
74
- value_schema = avro.load(' ValueSchema.avsc' )
75
- key_schema = avro.load(' KeySchema.avsc' )
74
+
75
+ value_schema_str = """
76
+ {
77
+ "namespace": "my.test",
78
+ "name": "value",
79
+ "type": "record",
80
+ "fields" : [
81
+ {
82
+ "name" : "name",
83
+ "type" : "string"
84
+ }
85
+ ]
86
+ }
87
+ """
88
+
89
+ key_schema_str = """
90
+ {
91
+ "namespace": "my.test",
92
+ "name": "key",
93
+ "type": "record",
94
+ "fields" : [
95
+ {
96
+ "name" : "name",
97
+ "type" : "string"
98
+ }
99
+ ]
100
+ }
101
+ """
102
+
103
+ value_schema = avro.loads(value_schema_str)
104
+ key_schema = avro.loads(key_schema_str)
76
105
value = {" name" : " Value" }
77
106
key = {" name" : " Key" }
78
107
You can’t perform that action at this time.
0 commit comments