Git Product home page Git Product logo

Comments (7)

fmvilas avatar fmvilas commented on July 20, 2024

I think in this approach it would be good to include a host and schemes on each topic since a service may accept incoming commands via unencrypted channels (mqtt) but only emit events via encrypted ones (mqtts).

That's a very interesting point. I think we can consider it for the next version. What do you think? How do you feel about contributing to it?

Thanks!

from spec.

ignasi35 avatar ignasi35 commented on July 20, 2024

I just realised this is particularly necessary when a microservice emits events on a topic and has a endpoint implemented using websockets.

I'll think about that.

from spec.

fmvilas avatar fmvilas commented on July 20, 2024

Also, I think before I didn't get your question totally right. The spec defines what the service (the computer program) does. So when you see subscribe it means the service will be subscribed and listening to this topic. It also means, consumers will need to publish to this topic in order to communicate with the service. So we could say the spec is seen "from the service perspective" and the service is the owner of that spec.

In other words, the spec defines what the API does and not what the API expects you (as a consumer) to do.

It should probably be clearer in the docs.

from spec.

ignasi35 avatar ignasi35 commented on July 20, 2024

@fmvilas does that mean that if ServiceA publishes to topic A, and there are 10 consumers then all 10 consumers will have to specify that they subcribe to topic A and what are the contents of the message. That would have 11 copies of the same information.

If we look at the world pre-AsyncAPI and imagine 10 service doing HTTP requests to Service A, there's no need to specify on each of those 10 services that they will consume /service-a/endpoint3/:id.

I am missing something... :-(

from spec.

fmvilas avatar fmvilas commented on July 20, 2024

does that mean that if ServiceA publishes to topic A, and there are 10 consumers then all 10 consumers will have to specify that they subcribe to topic A and what are the contents of the message. That would have 11 copies of the same information.

Yes, you'd have 11 copies of the same information. However, if you don't want to copy/paste it, you can always separate the message definition in a separate file/url and link them from all the places. And the definition will just remain in a single place. For instance:

$ref: "http://path-to-my-message-definition/message.yml"

If we look at the world pre-AsyncAPI and imagine 10 service doing HTTP requests to Service A, there's no need to specify on each of those 10 services that they will consume /service-a/endpoint3/:id.

There's no need because communication in HTTP APIs is always started by the client. You make a request and expect a response. However, consider the following example with HTTP APIs: if ServiceA wants to request something to ServiceB, then ServiceA expects a response. If you want to know how the response will be, you would have to grab ServiceB definition from ServiceA to know about it. You will have exactly the same problem. Information is not duplicated but ServiceA is coupled to ServiceB.


It obviously introduces coupling at message level, but it's because the message is shared by many services, and it's actually a dependency of many services. If you're using a message broker the only idea that comes to my mind is that these messages are defined in a "shared messages" project.

If another alternative comes to your mind, please don't hesitate to make a proposal :).

from spec.

ignasi35 avatar ignasi35 commented on July 20, 2024

If another alternative comes to your mind, please don't hesitate to make a proposal :).

Sure! What is your preferred channels to discuss proposals? Should I go with a full PR directly?

from spec.

fmvilas avatar fmvilas commented on July 20, 2024

I think we should use Github issues because it allows other people to participate too. You can also join the Slack channel: https://async-apis-slack.herokuapp.com/

from spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.