【问题标题】:How to fetch the schema from Azure eventhub using Golang如何使用 Golang 从 Azure eventthub 获取架构
【发布时间】:2020-12-17 05:59:24
【问题描述】:

我在 eventthub 中创建了架构,我正在使用“github.com/Azure/azure-event-hubs-go/v3”包通过 Go 接收和发送消息到 eventthub。

如何使用 Schema 序列化/反序列化正在发送或接收的数据?

【问题讨论】:

  • 你能找到答案吗?

标签: go avro azure-eventhub


【解决方案1】:

访问架构不依赖于正在使用的消息队列。

为了获取 avro 架构,我们可以使用标准的 net/http 包,因为有返回架构的 API。

网址将采用以下格式:

如果 avro 主题和版本已知:

https://<schema_registry_url>/subjects/<subject_name>/versions/<version_number>

If the latest version schema is required `<version_number>` can be replaced with `latest`

如果架构 ID 已知:

https://<schema_registry_url>/schemas/ids/<id>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-02-10
    • 1970-01-01
    • 1970-01-01
    • 2020-04-08
    • 2019-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多