-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
feat: separate servers as provided and used ones #874
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
I think this problem is also related to the "collection of the applications" problem - #658 Honestly looking at the solutions I don't think I like any of them 😆 or rather, I don't like the ways of describing these things. At first glance I wondered why we need this I also wonder why you dropped the nested fields Maybe instead of the On the other hand, the It's hard for me to say which way we should go. |
Yeah, it may also be related but we ditched this long ago. We're not gonna solve it for v3.0.0.
A system can also be a collection of applications, which can make it confusing. A domain is a more common word in EDA and Domain-Driven Design. A domain is more about the boundaries of the information and the responsibilities. If we're not happy with that word, I'd suggest using
No problem. I just thought this naming was more explicit as suggested by @thake at #689 (comment).
I think you're confusing |
I'm having a hard time understanding what we need it for. How is this related to pub/sub confusion? remote/local made sense. Majority of cases are EDA with broker, so And sorry but I still don't get 👇🏼 #811 (comment)
Where is this "domain" idea coming from originally? I only heard from people here and there that they would like to "describe their broker with AsyncAPI" or "that having AsyncAPI document created for a broker is useful for them as then they could have broker-specific bindings also provided to handle broker provisioning based on provided data". So at the moment, my brain automatically maps the idea of a domain to the idea of enabling people to describe broker PS. mentioning it here and not in related issue as I think it is related |
Yes, that's exactly why I think it should be separate things. A server may be local for one application but remote for the rest. So
Yes, some people will want it to define a broker. Some people might want to define a subset of what they find in a broker. Some people will want to define reusable objects between an HTTP/WS server and client(s). So, what I'm trying to do here is to be a little less opinionated and offer a solution that will work for all of them. Again, Does that make sense now @derberg? |
Thanks for the clarification! Hmm, when it comes to naming As for this naming, as I wrote I prefer the name asyncapi: 3.0.0
kind: library
info:
title: Reusable components of domain/system
version: 0.1.0
components:
... no It also makes me wonder how this |
Partially 😄 We're not saying that an application belongs to a certain domain at any time. Only that an application is using "resources" from a given domain (when the application AsyncAPI file If we ever want to get into describing a
Please note that "something is generic" might be an advantage here. Some people might be into DDD and will understand the concept of a domain but some will not. Actually, most engineers don't understand it or deal with this concept at all :)
I like it. It might make it easier to spot. |
It will be a long comment, sorry, but I want to write down how I got to my conclusions. AsyncAPI for Kafka broker
AsyncAPI for WebSocket server
AsyncAPI for "I have no idea what broker" but for transport WebSocket is used
AsyncAPI for consumer app that listens to some specific messages from topic A of some Kafka broker
Some thoughts on "application" At the moment spec says:
So doesn't matter if you have application, broker, or one file for "internal" broker operations and one file for "external" broker operations, or maybe you just describe operations of a set of IoT devices -> in the end we do not, and we should not assume what it is. It is all about
I think we just need to update the spec to not use We should just describe all possible definitions out there (we kinda have it already) and introduce a clear definition that groups all the others. Taking current spec:
@fmvilas Yeah, we have this social media example in the
This is actually common and makes lots of sense to me. Otherwise APIMatic would not be a profitable business. In the end it is all about the The same is with AsyncAPI. You can have multiple files that you bundle into one for the customer.
So my point is, we should just say The conclusion of my brain exercise is that:
Sorry for a long comment but I wanted to write down my thoughts and how I got into my conclusions so it is easier to understand where I'm coming from and prove me wrong. I just think that:
|
My thoughts are along a similar line to @derberg, I think. My use of AsyncAPI is essentially API documentation for Kafka - to allow someone who has a Kafka topic to share that Kafka topic with other developers in their organisation, by enabling them to describe the events that are on that topic and how they could be used. That needs to include describing where the Kafka cluster is - to allow other developers to be able to connect to the cluster and consume the events. But if we went down this path of separating servers - which would I use. In this scenario, would my Kafka cluster be a "provided" server or a "used" server? |
@dalelane you would do it under |
As I can see, this PR is not ready to be introduced in v3.0.0 and it might even introduce more confusion. Therefore, I'm going to close it and will propose an Agree with that? @derberg @dalelane @char0n @smoya @magicmatatjahu @jonaslagoni |
Separate servers as
providedServers
andusedServers
Related issue(s):
#689
#618
Potential concerns
Now
providedServers
andusedServers
don't make sense anymore in the "domain" kind of document. It makes sense when we're talking about an application only. Some ideas on how to overcome this issue:Idea 1. Have servers, providedServers, and usedServers
This adds unnecessary overhead to the document but might not be that bad. We should restrict
[provided|used]Servers
to be $ref pointers to theservers
object. In other words, they should always start with#/servers/
. Otherwise, why would we want to have servers in the first place, right?Idea 2. Add a new top-level field to determine the kind of document.
This will clearly help us identify when the user is using AsyncAPI to document an application or a collection/domain of things. For instance:
Idea 3. Create a new spec for the "domain" kind of document.
We can still start these documents with:
However, the spec itself will be in a separate place. The reason I'm proposing this idea is that the current spec contains lots of references to "this application", which will not make sense in a kind of document that's not meant for applications. We either separate specs in different documents or fix these occurrences and are very careful not to introduce new ones in the future.
Idea 4. Split the AsyncAPIObject (root object) in the spec into
application
anddomain
objects.We keep everything in the same spec but we make it super clear that application-related documents can have a set of fields and domain-related documents can have a different one. We fix the "this application" occurrences and are very careful not to introduce new ones in the future.
Notice how this problem is not appearing only with the introduction of
usedServers
andprovidedServers
. We already had that problem withoperations
because they only make sense in anapplication
kind of document.We now have 3 different properties that don't make sense outside the application realm. We should clean this before it bites us later.