authorjapps / authorjapps/zerocode
Send AVRO content to kafka
- Dominant language
- Java
- Stars
- 1k
- Forks
- 453
- Avg merge
- 7d 2h
- Merged PRs (30d)
- 5
Description
Hi,
We try to send kafka message using AVRO and schema registry.
Right now, we've been trying to do something like this:
on configuration
``` properties
key.serializer=org.apache.kafka.common.serialization.StringSerializer
value.serializer=io.confluent.kafka.serializers.KafkaAvroSerializer
```
on test
``` json
{
"name":"send avro message",
"url":"kafka-topic:command",
"operation":"produce",
"request": {
"recordType" : "JSON",
"records": [
{
"key": "test",
"value": {
"property" : "001"
}
}
]
},
"verify": {
"status": "Ok",
"recordMetadata": "$NOT.NULL"
}
}
```
ZeroCode serialize this code using avro and send it. But it doesn't use the existing schema for the object.
On the schema registry, we have this schema:
``` json
{
"type" : "record",
"name" : "TestKafkaMessage",
"namespace" : "com.foo.bar",
"fields" : [ {
"name" : "property",
"type" : "string"
}]
}
```
Instead of use the existing schema, it create a new one `command-value` with the content :
``` json
"string"
```
#### Expected Behaviour:
Be able to specify a schema (using file, json, or schema registry reference) to serialize json using this schema.
Is this already possible? Is there any other way?
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.