|
| 1 | +--- |
| 2 | +sidebar_position: 1 |
| 3 | +--- |
| 4 | + |
| 5 | +# Overview |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +## Reactive Commons |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +The purpose of reactive-commons is to provide a set of abstractions and implementations over different patterns and practices that make the foundation of a reactive microservices architecture. |
| 14 | + |
| 15 | +Even though the main purpose is to provide such abstractions in a mostly generic way such abstractions would be of little use without a concrete implementation so we provide some implementations in a best effors maner that aim to be easy to change, personalize and extend. |
| 16 | + |
| 17 | +The first approach to this work was to release a very simple abstractions and a corresponding implementation over asyncronous message driven communication between microservices build on top of project-reactor and spring boot. |
| 18 | + |
| 19 | + |
| 20 | +## Project Reactor |
| 21 | + |
| 22 | +[Reactor](https://projectreactor.io) is a highly optimized reactive library for |
| 23 | +building efficient, non-blocking applications on the JVM based on the |
| 24 | +[Reactive Streams Specification](https://github.com/reactive-streams/reactive-streams-jvm). |
| 25 | +Reactor based applications can sustain very high throughput message rates |
| 26 | +and operate with a very low memory footprint, |
| 27 | +making it suitable for building efficient event-driven applications using |
| 28 | +the microservices architecture. |
| 29 | + |
| 30 | +Reactor implements two publishers |
| 31 | +[Flux\<T>](https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html) and |
| 32 | +[Mono\<T>](https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html), |
| 33 | +both of which support non-blocking back-pressure. |
| 34 | +This enables exchange of data between threads with well-defined memory usage, |
| 35 | +avoiding unnecessary intermediate buffering or blocking. |
| 36 | + |
| 37 | +## Reactive API for Event Mechanism |
| 38 | + |
| 39 | +Reactive Commons is a reactive API for asynchronous message driven communication based on Reactor. |
| 40 | +Reactive Commons API enables messages to be published over a event bus like RabbitMQ or SNS/SQS and consumed using functional APIs with non-blocking back-pressure and low overheads. |
| 41 | +It enables applications using Reactor to use RabbitMQ or SNS/SQS as a message bus, integrating it with other systems to provide an end-to-end reactive system. |
| 42 | + |
| 43 | +When we talk about asynchronous message driven communication, we can use several sematic ways to use the term "message". So, we can talk about Events, Commands and Queries. |
| 44 | + |
| 45 | +## Cloud Events |
| 46 | + |
| 47 | +[CloudEvents](https://cloudevents.io/) is a specification for describing event data in a common way. CloudEvents seeks to dramatically simplify event declaration and delivery across services, platforms, and beyond! |
| 48 | + |
| 49 | +## Async API |
| 50 | + |
| 51 | +[Async API](https://www.asyncapi.com/) Open-Source tools to easily build and maintain your event-driven architecture. All powered by the AsyncAPI specification, the industry standard for defining asynchronous APIs. |
| 52 | + |
| 53 | +## Reactive Commons Abstraction |
| 54 | + |
| 55 | +#### Events - Pub/Sub |
| 56 | + |
| 57 | +Events represent a fact inside the domain, it is the representation of a decision or a state change that a system want to notify to its subscribers. Events represents facts that nobody can change, so events are not intentions or requests of anything, An example may be and UserRegistered or a NotificationSent. |
| 58 | + |
| 59 | +Events are the most important topic in a Publish-Subscribe system, because this element let's notify a many stakeholders in a specific event. An other benefit is the system is decouple, because you can add more subscriber to the system without modify some component. |
| 60 | + |
| 61 | +We support a Notification Event pattern in which each instance of an app can receive an event, it can be used to refresh or invalidate some data in all replicas. |
| 62 | + |
| 63 | +#### Commands |
| 64 | + |
| 65 | +Commands represent a intention for doing something, that intention must to be done by the domain context with that responsibility. An example of a command may be: "registerUser" or "sendNotification". |
| 66 | + |
| 67 | +#### Request / Reply |
| 68 | + |
| 69 | +Queries represent a intention for getting information about something, that query must to be processed by the domain context with that responsibility and that context must respond with the information requested throught request/reply pattern. An example of a query may be: "UserInfo". |
| 70 | + |
| 71 | +## Versioning |
| 72 | + |
| 73 | +Reactive Commons uses [Semantic Versioning Specification](https://semver.org) |
| 74 | + |
| 75 | +Reactive Commons uses a MAJOR.MINOR.PATCH scheme, whereby an increment in: |
| 76 | + |
| 77 | +MAJOR version when you make incompatible API changes, |
| 78 | + |
| 79 | +MINOR version when you add functionality in a backwards compatible manner, and |
| 80 | + |
| 81 | +PATCH version when you make backwards compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. == New & Noteworthy |
| 82 | + |
0 commit comments