You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using [email protected], I have a topic called test, I'm using the RecordNameStrategy and have registered a subject test in the schema registry.
Producing my message:
class test { }
const producer = await kafkaAvro.getProducer()
const data = new test()
data.long_field = 10
producer.produce('test', -1, data, 'key');
Produces the message but without the encoded schema.
The problem seem to stem from the fact that kafka-avro seems opinionated about the subject name (and I didn't see it mentioned in the docs). It seems to expect all topics to either end with -value or -key:
Using
[email protected]
, I have a topic calledtest
, I'm using theRecordNameStrategy
and have registered a subjecttest
in the schema registry.Producing my message:
Produces the message but without the encoded schema.
The problem seem to stem from the fact that
kafka-avro
seems opinionated about the subject name (and I didn't see it mentioned in the docs). It seems to expect all topics to either end with-value
or-key
:kafka-avro/lib/schema-registry.js
Line 356 in ee5fcaa
If it doesn't match that, it falls back and puts it in the keys schemas and doesn't put it in the values schemas:
kafka-avro/lib/schema-registry.js
Line 432 in ee5fcaa
And then when it tries to produce the message it won't find the schema as it's not in the values schemas dictionary and fail to encode it.
The text was updated successfully, but these errors were encountered: