在记录事件模式时使用哪些工具

问题描述:

我们的团队开始实施事件驱动的设计.现在,我们正在寻找记录这些事件模式的最佳工具和实践.

Our team is starting to implement event driven designs. We are now figuring what's the best tool/s and practices for documenting the schema of these events.

此用例使用哪些常用工具?

What are the common tools used for this use case?

感谢任何链接或建议.

我将从常见的 CloudEvents规范开始并基于此对我的事件进行建模,即将事件定义为通用CloudEvent模型的子类型.这样做的好处是可以与基于相同规范以及现有工具(例如语言SDKs .

I would start off with the common CloudEvents spec and model my events based on that, i.e., define the events as subtypes of the generic CloudEvent model. The benefit here is interoperability with other systems based on the same spec as well as the existing tooling such as language SDKs.

对于文档,我将使用JSONSchema:这是例如,通用CloudEvent的JSONSchema定义.

As for documentation, I'd go for JSONSchema: here's the JSONSchema definition for a generic CloudEvent for example.

作为替代方案,可以使用 AsyncAPI 规范,您可以代替或与CloudEvents一起使用: a href ="https://www.asyncapi.com/blog/asyncapi-cloud-events/" rel ="nofollow noreferrer">在此处阅读.

As an alternative, there's the AsyncAPI specification which you can use instead of or together with CloudEvents: read here on how the two relate.