diff --git a/example/producer_avro/main.go b/example/producer_avro/main.go index c954efb..219b53f 100644 --- a/example/producer_avro/main.go +++ b/example/producer_avro/main.go @@ -38,6 +38,9 @@ func main() { log.Panic(err) } for { + // The DummyEvent type is generated using `hamba/avro` (see make). This is the preferred generation for + // `formatter=zkafka.AvroSchemaRegistry` because the underlying serializer uses the avro tags on the generated struct + // // to properly connect the schema and struct event := DummyEvent{ IntField: rand.Intn(100), StringField: randomNames[rand.Intn(len(randomNames))], diff --git a/example/worker_avro/main.go b/example/worker_avro/main.go index d70ef7b..8050c49 100644 --- a/example/worker_avro/main.go +++ b/example/worker_avro/main.go @@ -80,6 +80,10 @@ func main() { func Process(_ context.Context, msg *zkafka.Message) error { // sleep to simulate random amount of work time.Sleep(100 * time.Millisecond) + + // The DummyEvent type is generated using `hamba/avro` (see make). This is the preferred generation for + // `formatter=zkafka.AvroSchemaRegistry` because the underlying deserializer uses the avro tags on the generated struct + // to properly connect the schema and struct event := DummyEvent{} err := msg.Decode(&event) if err != nil {