Open SamyLegal opened 4 months ago
Hey @SamyLegal,
Please see FAQ No. 12 on README.
Thank you for the answer @mostafa
I have read the FAQ No. 12 on README and i have try my schema without references with the tool https://github.com/mostafa/nested-avro-schema and all works fine.
I think my error is not related to nested schemas Avro but an Avro schema that contains references to others schemas in a schema registry like this :
{
"type": "record",
"name": "PieceChangeStream",
"namespace": "fr.mgdis.contract.kafka_connect.mongo.referentiel_piece",
"fields": [
{
"name": "ns",
"type": [
"null",
"com.mongodb.kafka.connect.source.Ns"
],
"default": null
},
{
"name": "_id",
"type": "string"
},
{
"name": "operationType",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "fullDocumentBeforeChange",
"type": [
"null",
"fr.mgdis.contract.kafka_connect.mongo.referentiel_piece.PieceDocument"
],
"default": null
},
{
"name": "fullDocument",
"type": [
"null",
"fr.mgdis.contract.kafka_connect.mongo.referentiel_piece.PieceDocument"
],
"default": null
},
{
"name": "to",
"type": [
"null",
"com.mongodb.kafka.connect.source.To"
],
"default": null
},
...
]
}
In the project, i have not found a unit test with this case. For you do you think is it works ?
The library "srclient" that you use in this project handle this case. https://github.com/riferrei/srclient/blob/baa74d8799c9533e679e30739a09346fbd8f6982/schemaRegistryClient_test.go#L291
Hi,
Currently, i develop a load test with xk6-kafka that use an Avro Schema with references. When i try to use a schema with references, i have an error/exception. The stacktrace of the error is present at the end of this message.
Kafka Scenario
For better understand our load test, I will explain our use case of Kafka.
We use Kafka Connect and MongoDB Source Kafka Connector to retrieve data from Mongo collections for insert them in Kafka.
We use this connector for multiple collections, so we have multiple Avro schemas that use MongoDb record schemas from this connector. For avoid to duplicate this elements of MongoDB schemas, when i create an Avro schema, I reference this Avro schemas instead of include them in my schema.
Avro schema of my principal entity
Exemple of reference schema
com.mongodb.kafka.connect.source.Ns
We use Apicurio Schema Registry with the "Confluent Compatibility" for that works with xk6-kafka. If i use a full schema without references my script work.
K6 script
My k6 script is as follows. I use the method "getSchema" with property "references" for retrieve my schema.
Stacktrace of the error
Have you got an idea of the origin of the error ? Is that scenario work with xk6-kafka ?