Closed rob3000 closed 3 years ago
Blocking is not an issue. You just wrap producer.send
in another async function that possibly generates the schema, encodes the key and value and then sends (note that this would be done outside of @kafkajs/confluent-schema-registry).
The problems I see are:
Foo1
, Foo2
).All in all, I don't see this being a useful feature. I could see a standalone tool for generating schemas from data being useful as a starting point, though. So you'd feed it an example of the data you're expecting to send, it generates a schema and then you tweak the schema to deal with some of the issues I mentioned above. It'd take some of the busywork out of writing schemas.
But I definitely don't see that being part of @kafkajs/confluent-schema-registry. The scope of this package is pretty clear - it interfaces with the Confluent schema registry to register and fetch schemas and then let's you encode/decode payloads. Schema creation is outside of the scope and doesn't really overlap with either @kafkajs/confluent-schema-registry or kafkajs.
Thanks for the great response @Nevon and all the problems raised make perfect sense. Thanks!
This is more of a question/enhancement, i was wondering if it would be possible to create a schema from a payload that is being sent say when using KafkaJS?
something like:
One of the limitations i can see would be blocking the sending of a message until the schema has been created. Thoughts?