Is there an OpenAPI type specification for Kafka or similar technology?
Asked Answered
T

3

10

OpenAPI is good for RESTful services and at the moment, I'm hacking it to do it for asynchronous messaging system (specifically Kafka) by using POST to a /topic so that I can use redoc do create a website for the API.

I am trying to see if there's already established system of documenting for this. Especially since the GET /events which is used for event sourcing is getting larger and larger by the day.

Thundering answered 2/12, 2019 at 17:7 Comment(1)
AsyncAPI?Wilhelmstrasse
P
8

It seems asyncAPI is basically what you are looking for: openapi but for topics instead of REST endpoints.

https://www.asyncapi.com/docs/getting-started/coming-from-openapi/

Polybasite answered 15/7, 2020 at 15:10 Comment(0)
L
1

CloudEvents is a CNCF backed project for documenting event sourcing, one specification is for Kafka

https://github.com/cloudevents/sdk-java/blob/master/kafka/README.md

If you want a REST API, look at the Kafka REST Proxy

Lyndsaylyndsey answered 2/12, 2019 at 20:41 Comment(0)
F
0

Consider using Protocol Buffers within Kafka. https://developers.google.com/protocol-buffers/

Protocol Buffers require an API contract (".proto" file) if you want to call or implement a service. The contracts are both human and machine readable.

Protocol Buffers can also be used with other messaging systems and other protocols like HTTP (check out "gRPC" for that). So your documentation / contract is more portable.

Of course this only works for projects having the flexibility to change their payload format.

Folksy answered 11/11, 2022 at 20:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.