有没有一种方法可以添加要包含在序列化数据(JSON格式)中的AVRO模式字段的doc属性?

时间:2020-01-17 06:12:38

标签: mqtt avro

我正在尝试将以下Avro模式发送到MQTT代理:

{
  "type": "record",
  "name": "LongList",
  "aliases": ["LinkedLongs"],                      // old name for this
  "fields" : [
    {"name": "value", "type": "long", "doc" : " This is name field"}     // each element has a long
  ]
}

我的MQTT客户端使用以下c API来序列化数据:

avro_schema_from_json_literal()
avro_file_writer_create()
avro_writer_memory()
avro_generic_class_from_schema()
avro_generic_value_new()
avro_value_get_by_name()
avro_value_reset()
avro_value_set_long() 

但是,当我将序列化数据发送给代理时,它仅接收字段“名称”的值。出于调试目的,我不时将“名称”的 doc字段发送给MQTT代理。

有人可以告诉我前进的方向吗?

如果您需要我的其他信息,请告诉我。

0 个答案:

没有答案