![]() ![]() The first step of documenting an event-driven architecture is to identify discrete components that produce or consume events. Identify event-driven applications in the solution The file format must be JSON or YAML however, only the subset of YAML that matches the JSON capabilities is allowed.įirst, we need to identify Applications in the solution. Our end goal is to share it with respective teams to generate the implementations, validators, and most importantly, the documentation.Īn AsyncAPI document is a file that defines and annotates the different components of a specific Event-Driven Application. Let’s try to document our solution as per the AsyncAPI specification. Most of the processes you apply to your REST APIs nowadays would apply to event-driven/asynchronous APIs.Ĭurrently, the specification is at version 2.0.0. A brings in critical activities from the REST API world, from documentation to code generation, from discovery to event management. AsyncAPI specification to the rescueĪsyncAPI is an open-source initiative that provides both a specification to describe and document your asynchronous applications in a machine-readable format and tooling (such as code generators) to make life easier for developers tasked with implementing them.ĪsyncAPI is built on the foundation of OpenAPI specification. Therefore, a proper process must be in place to describe different components of an event-driven system and their interactions.ĪsyncAPI specification comes into play at this point. If one team makes a change, it has to be visible across the board. In our solution, the format of the UserSignedUp event must be consistent across two services. Otherwise, maintaining the solution will become a nightmare in the long run. For example, all teams must maintain broker configurations, topics, and event formats in a central place. All teams must explicitly define any information exchanged across these boundaries. Two services will have their own context boundaries defined. There are strong reasons behind not doing so.Īccount and Email services are loosely coupled distributed services, potentially built, operated, and maintained by separated teams. Now we have a solution architecture in place. ![]() We can come up with a simple solution architecture as follows. The second service, the Email service, subscribed to receive those events to send the new user a welcome email. The first service, the Account service, publishes the UserSignedUp event when a new user account is created. Two event-driven microservices are communicating through a message broker in a publish/subscribe manner. ![]() Imagine you are designing a solution to the following use case. This post explains how to map a simple event-driven application architecture into corresponding AsyncAPI specifications by walking you through an example. AsyncAPI specification steps in to solve that gap. The information exchanged between them must be documented and maintained consistently for everyone’s visibility. That potentially leads to having many self-contained components in your architecture, managed by multiple teams. Event-driven applications are inherently distributed and loosely-coupled. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |