Closed wrichter closed 5 years ago
In today's integration quarterly update, they pointed to https://www.asyncapi.com
It is not only event bus interfaces, but interfaces in general. How do we describe interfaces?
GRPC / Protobuffers could also be an option. Nice lean, and async is easy, simple one way rpc call with no response, ore even a stream of events as response back
OpenAPI vs. gRPC comparison: https://medium.com/apis-and-digital-transformation/openapi-and-grpc-side-by-side-b6afb08f75ed
I find gRPC interesting, Do you know the extent of gRPC Support in the RH Toolchain? Wrt event/AsyncAPI interfaces, I think AsyncAPI is a better representation than a one-way gRPC since it has a native concept of topic spaces.
I have no clue. @ortwinschneider maybe? My understanding is that it uses HTTP/2 as transport, and good news - THAT is supported ingress with OpenShift V3.11: https://access.redhat.com/solutions/2274201
OpenAPI should be independent of a transport protocol version, so I believe HTTP/2 should also work for an HTTP interface defined via OpenAPI. Reading about this, a new aspect came to my mind - how to describe WebSocket interfaces?? This is likely not gRPC (since we cannot expect browsers to have support for it), but also not HTTP Verbs/status codes either (so OpenAPI is maybe not a good fit: https://github.com/OAI/OpenAPI-Specification/issues/523)
I tried to use OpenAPI to create the analysis model. From that experience: I don't like OpenAPI. It is far too fixed on REST and HTTP, so probably not suitable to describe event bus interfaces.
I will now experiment with PlantUML: use good old interfaces for sync interactions, and classes describing async events. That did work already in a white board session with @ortwinschneider, so let me try to get code it....
Have you looked at AsyncAPI yet?
Let me start an assessment of the Option "AsyncAPI" so we can later copy/paste to an architectural decision document. Please edit this note as desired!
AsyncAPI is an extension/variation of OpenAPI by adding async/event handling capabilities. Details here. The Getting Started doc is a quick read while providing good overview.
Pro:
Contra:
Open Questions:
PlantUML can be used to describe async events. High level in e.g. a component diag could look like this:
On a more fine grained level, it could look like this:
Edit: Did add some aspects to the evaluations above
I vote for a combination: we go with AsyncAPI where possible, and if the interface is still to vague, we go with PlantUML or simply textual description
For HTTP interfaces, we can use a Swagger/OpenAPI definition, which can be rendered into a Test UI and used for scaffolding of implementations and client code. Can we use something equivalent for event bus based interfaces(#16)?