【问题标题】:How to remove unnecessary information from Kafka Schema Registry?如何从 Kafka Schema Registry 中删除不必要的信息?
【发布时间】:2022-11-17 21:55:01
【问题描述】:

我目前正在使用 Kafka 和 Debezium 从 Mongo 数据库中提取一些数据。当数据被摄取时,模式注册表 (Confluent) 会显示一些额外的不需要的信息,这些信息会导致模式版本比预期的多。这是“不需要的”模式的类型:

...
       {
          "connect.name": "mongodbserver1.data_transformer.api_data_asset.content.text_representation",
          "fields": [
            {
              "default": null,
              "name": "language",
              "type": [
                "null",
                "string"
              ]
            },
            {
              "default": null,
              "name": "script",
              "type": [
                "null",
                "string"
              ]
            }
          ],
          "name": "text_representation",
          "namespace": "mongodbserver1.data_transformer.api_data_asset.content",
          "type": "record"
        }
      ]
    },
...

有什么办法可以避免这种类型的模式信息?

【问题讨论】:

    标签: apache-kafka confluent-schema-registry


    【解决方案1】:

    据此,您的数据库中有一个 text_representation 对象,因此,它将成为您的模式的一部分。

    您可以选择使用 Connect 转换在记录实际传递到 AvroConverter 之前更改记录的格式,AvroConverter 决定将什么注册到注册表,而不是 Debezium。

    【讨论】:

      猜你喜欢
      • 2020-09-28
      • 2018-10-07
      • 2020-08-11
      • 2021-03-08
      • 2017-11-27
      • 1970-01-01
      • 1970-01-01
      • 2019-07-21
      • 2018-02-23
      相关资源
      最近更新 更多