avro-python3版本1.9.0-带有logicalType字段的RecordSchema不可序列化JSON

时间:2019-07-10 22:50:18

标签: apache-kafka avro

运行生产者将avro消息推送到kafka主题时,出现错误“类型为mappingproxy的对象不可JSON序列化”。

我的Avro架构如下:

{
  "type": "record",
  "name": "tch_users",
  "namespace": "tch",
  "fields": [
    {
      "name": "id",
      "type": "string",
      "doc": "User ID"
    },
    {
      "name": "name",
      "type": "string",
      "doc": "User name"
    },
    {
      "name": "created_at",
      "type": {
        "type": "long",
        "logicalType": "timestamp-millis"
      },
      "doc": "Date of registration"
    }
}

0 个答案:

没有答案