如何以编程方式将 avro 架构转换为 asyncapi?

问题描述 投票:0回答:1

我现在想知道是否存在一个 cli 工具来将 avro 架构文件转换为 asyncapi 文件。

提前非常感谢

avro asyncapi
1个回答
0
投票

我不知道这样的工具是否存在以及是否一定会存在。问题是这些标准有不同的目的

Avro:它就像定义消息结构的模式格式

AsyncAPI:它处于更高的级别,它描述了应用程序行为,并且可以包含有关其连接的代理、发送和消费消息的通道的大量附加信息。

由于 Avro 范围有限,任何要转换为 AsyncAPI 的 CLI 都必须具有一些自定义功能,使您能够提供 AsyncAPI 文档所需的更多元数据。

好的一点是您可以在 AsyncAPI 中使用 Avro

AsyncAPI 文档中描述的消息示例:

messages:
  userSignedUp:
    payload:
      schemaFormat: 'application/vnd.apache.avro;version=1.9.0'
      schema:
        type: record
        name: UserSignedUp
        namespace: com.company
        doc: User sign-up information
        fields:
          - name: userId
            type: int
          - name: userEmail
            type: string

更多详细信息:https://www.asyncapi.com/docs/tutorials/kafka/configure-kafka-avro

© www.soinside.com 2019 - 2024. All rights reserved.