geomagilles opened a new issue #8430:
URL: https://github.com/apache/pulsar/issues/8430
**Describe the bug**
When using `Schema.AVRO(mySchemaDefinition)` custom
SchemaWriter/SchemaReader provided in `mySchemaDefinition` are not used even if
present in mySchemaDefinition.
The use case is to be able to serialize/deserialize Kotlin data classes
using avro4k package by providing custom Avro reader/writer.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
This could work
```
val schemaDefinition = SchemaDefinition.builder<TaskEngineEnvelope>()
.withJsonDef(Avro.default.schema(MyMessage.serializer()).toString())
.withSchemaReader(MyMessageReader())
.withSchemaWriter(MyMessageWriter())
.withSupportSchemaVersioning(true)
.build()
val client = PulsarClient.builder()
.serviceUrl("pulsar://localhost:6650")
.build()
val consumer = client.newConsumer(Schema.AVRO(schemaDefinition))...
```
**Additional context**
Maybe there is another way?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]