-
-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating the AsyncAPI Domain specification #811
Comments
oh, new spec 👀
I'm not 100% opinionated yet, but my thoughts so far are
Do you mean that because of |
Yes, but that's only the key name. They're Server Objects.
Precisely. People are already doing it by misusing the spec. Let's give them a proper format for that. I don't think the complexity will grow a lot because this new spec is made of existing definitions in the spec. It's just another file with a new name to make it explicit that it's about a group of things and not about an application. Pretty much what we have right now in v3 if you omit the
I can imagine it because it's actually happening 😄 I just don't think it's ideal and we can do better. |
I agree is not a very common use case but what about the Event-Gateway, where the application (the event-gateway running app) exposes a Kafka proxy? The protocol cannot be only HTTP or WS. |
An event gateway is not a common application IMHO. It's a server implementing any protocol and publishing and subscribing to all the channels. That would be defined using this new spec instead of the current Application spec. |
More and more I'm thinking about, I think it will complicate things, and that we do not really need it.
I just keep thinking about examples out there in the wild and the only one that comes to my mind is JSON Schema. So JSON Schema is for validation, but people (including us) misuse it by using it for code generation. Community introduced new spec for that but it is not adopted. What people do (including us)? we continue misuse JSON Schema as for majority of cases it is ok. We are not lazy, we are pragmatic. Introducing new spec is not the same level of complexity as introducing new property in existing spec.
I mean, the more I deep dive into the word of WebSocket, the more I'm convinced we are wrong with initial assumption. WebSocket has this core feature of sub protocols, and even official docs say that WebSocket when used only as transport in combination of subprotocol is called a MessageBroker. You can write a server application that connects with WebSocket message broker, and then subscribes only to specific topics. You might want to describe your server application with AsyncAPI and then WebSocket server is Frankly speaking, you do not need sub protocol in use for that. Wouldn't you like to write AsyncAPI file for your mobile app that uses websocket API? I see benefits. The difference is that for:
Sorry for long context What I'm trying to say is, AsyncAPI is already used by people to describe what is available on a broker, so let them do it, without hiding it, because even if we do additional spec, they will still do the hacks 🤷🏼 I think it is completely fine to say |
Basing on recording of last 3.0 meeting https://www.youtube.com/watch?v=7CymWygvWwI @fmvilas can you highlight why we need a new spec or even a new flag to indicate it is Application or a Broker. Dumb question ahead: Why cannot spec say that it is for both and I ask this question in reference to my previous comment about Websocket that is a MessageBroker. It will be super confusing when you say: "so you describe WebSocket app that is a broker, but it is an app owning channels, so you use I really cannot imagine/understand why this is important to have an explicit flag. Even now I can have app described with AsyncAPI without operations, and some code generators will fail. So why spec need a flag or new spec, and not tools simply require certain objects? Maybe we have a bad definition of an app 😄 |
It is not "it is Application or a Broker". It is about being an Application or simply a collection of resources (messages, channels, servers, etc.). I called the latter a Domain for the lack of a better term. Can also be called a Library, Menu, etc. For Domain aka Library aka Menu, the purpose is to hold a set of reusable stuff. It's not a specific application.
Yes, that's exactly what I proposed in the call. We just make For instance, in the future, we may want to allow people to define reusable operations. This can be especially useful when you have multiple clients subscribing to the same channel. In such a case, the I think changing the meaning of the whole document exclusively based on the presence/absence of a field that is completely unrelated is a weak design. So to answer your question: is it needed? no, but I think it's more resilient to future changes. Can we just rely on the
I'm using the Application meaning from the spec:
|
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
I'm closing this issue as, of now, we're not going to make it. |
TL;DR
channels
in the good old AsyncAPI document will now refer only to channels exposed and owned by the application, like WebSocket or Socket.IO channels, and HTTP Server-Sent Events (I can't actually think of any other kind of channel an application can expose, maybe IPC?).servers
can only use the HTTP or WS protocol. Remote servers can be of any kind.domains
.Abstract
So far, we've always recommended people to extract server, channel, message, and schema definitions into a 3rd file they can reference from all the AsyncAPI Application definitions. This way, they keep them DRY.
It seems unavoidable to have this third file when defining broker-based architectures. Simply having 2 applications publishing and consuming from the same channels will make you want to split things out. Therefore, what I'm proposing here is to give an official name and structure to this 3rd file: the AsyncAPI Domain specification.
This proposal is motivated by previous conversations where we were discussing making the AsyncAPI document represent an application except when it doesn't have the
operations
keyword. In such a case, it would be defining a menu of available servers, channels, messages, etc. Not coupled to a specific application at all. It's precisely this kind of polymorphism that was driving me nuts. An apparently innocent keyword likeoperations
was changing the whole meaning of the whole document. That's a big no-no to me.Example
Global Company Domain
A domain for the whole company, to simplify things.
Usage from an application definition
The text was updated successfully, but these errors were encountered: