-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
deprecated/questionQuestions should happened in GitHub DiscussionsQuestions should happened in GitHub Discussions
Description
Describe the bug
Unable to add AVRO schema on a topic using producer client.
To Reproduce
Steps to reproduce the behavior:
- create a topic
- produce a message with json schema
Producer<User> producer = client.newProducer(Schema.JSON(User.class)).topic(Commons.TOPIC).create();
User user = new User("rahul",31);
MessageId msgId = producer.send(user);
- get schema api - return json schema type
{
"getSchemaResponses": [
{
"version": 0,
"type": "JSON",
"timestamp": 0,
"data": "{\"type\":\"record\",\"name\":\"User\",\"namespace\":\"com.optum.link.pulsar\",\"fields\":[{\"name\":\"name\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"age\",\"type\":\"int\"}]}",
"properties": {
"__jsr310ConversionEnabled": "false",
"__alwaysAllowNull": "true"
}
}
]
}
- produce 2nd message with avro schema
Producer<User> producer = client.newProducer(Schema.AVRO(User.class)).topic(Commons.TOPIC).create();
User user = new User("josh",31);
MessageId msgId = producer.send(user);
- get schema api - returns only previously created json schema object. it did not include AVRO schema
{
"getSchemaResponses": [
{
"version": 0,
"type": "JSON",
"timestamp": 0,
"data": "{\"type\":\"record\",\"name\":\"User\",\"namespace\":\"com.optum.link.pulsar\",\"fields\":[{\"name\":\"name\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"age\",\"type\":\"int\"}]}",
"properties": {
"__jsr310ConversionEnabled": "false",
"__alwaysAllowNull": "true"
}
}
]
}
Expected behavior
Avro schema should be added pulsar schema registry, or if this is not feasible then producer client should throw error
Screenshots
NA
Desktop (please complete the following information):
- OS: iOS
- Pulsar: 2.7.0
- Pulsar Client: 2.7.0
Additional context
I could successfully produce/consume messages using json schema.
Metadata
Metadata
Assignees
Labels
deprecated/questionQuestions should happened in GitHub DiscussionsQuestions should happened in GitHub Discussions