Slackbot
04/15/2023, 10:08 PMEnrico Olivelli
04/16/2023, 1:46 PMAnthony Ikeda
04/16/2023, 6:22 PMMultiVersionAvroReader : Load schema reader for version(0), schema is : {"type":"record","name":"ProductKey","namespace":"com.example.pulsarproducerapp","fields":[{"name":"dept","type":["null","string"],"default":null},{"name":"sku","type":["null","string"],"default":null}]}, schemaInfo: {
"name": "",
"schema": {
"type": "record",
"name": "ProductKey",
"namespace": "com.example.pulsarproducerapp",
"fields": [
{
"name": "dept",
"type": [
"null",
"string"
]
},
{
"name": "sku",
"type": [
"null",
"string"
]
}
]
},
"type": "AVRO",
"timestamp": 0,
"properties": {
"__alwaysAllowNull": "true",
"__jsr310ConversionEnabled": "false"
}
}
MultiVersionAvroReader : Load schema reader for version(0), schema is : {"type":"record","name":"ProductValue","namespace":"com.example.pulsarproducerapp","fields":[{"name":"createdBy","type":["null","string"],"default":null},{"name":"description","type":["null","string"],"default":null},{"name":"name","type":["null","string"],"default":null}]}, schemaInfo: {
"name": "",
"schema": {
"type": "record",
"name": "ProductValue",
"namespace": "com.example.pulsarproducerapp",
"fields": [
{
"name": "createdBy",
"type": [
"null",
"string"
]
},
{
"name": "description",
"type": [
"null",
"string"
]
},
{
"name": "name",
"type": [
"null",
"string"
]
}
]
},
"type": "AVRO",
"timestamp": 0,
"properties": {
"__alwaysAllowNull": "true",
"__jsr310ConversionEnabled": "false"
}
}
Here is how I'm setting the schema in code (Java):
Schema<ProductKey> keySchema = Schema.AVRO(ProductKey.class);
Schema<ProductValue> valueSchema = Schema.AVRO(ProductValue.class);
Schema<KeyValue<ProductKey, ProductValue>> schema = Schema.KeyValue(
keySchema,
valueSchema,
KeyValueEncodingType.INLINE);
Producer<KeyValue<ProductKey, ProductValue>> producer = null;
producer = client.newProducer(schema)
.topic(TOPIC)
.create();
ProductKey key = new ProductKey();
key.setDept(dept);
key.setSku(sku);
ProductValue value = new ProductValue();
value.setName(name);
value.setDescription(description);
value.setCreatedBy("me");
producer.newMessage().value(new KeyValue<>(key, value)).send();
producer.close();
How would this translate to pulsar-admin schemas upload ?Anthony Ikeda
04/17/2023, 4:15 PMEnrico Olivelli
04/22/2023, 3:18 PMEnrico Olivelli
04/22/2023, 3:19 PMAnthony Ikeda
04/24/2023, 3:33 PM