iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
88.31k stars 26.21k forks source link

Microservice pattern: Domain event #2670

Open iluwatar opened 8 months ago

iluwatar commented 8 months ago

Description

The Microservices - Domain Event design pattern is used to achieve a reliable communication mechanism between microservices. This pattern ensures that different services can react to changes or events occurring in other services without needing to tightly couple their operations. By leveraging domain events, we can decouple services, ensuring scalability and maintainability.

Main Elements of the Pattern:

  1. Domain Events: Represent significant state changes within a service that other services might be interested in.
  2. Event Publisher: The component within a service that publishes the domain event to an event broker.
  3. Event Broker: A middleware that handles the distribution of domain events to subscribing services.
  4. Event Subscriber: The component within a service that subscribes to domain events and reacts accordingly.

Benefits:

References

  1. Microservices Architecture
  2. Domain Event Pattern
  3. Project Contribution Guidelines
  4. Domain Event in Microservices

Acceptance Criteria

  1. Implement the Domain Event design pattern in the project, including event publishers and subscribers.
  2. Ensure proper documentation and examples are provided for the implemented pattern.
  3. Add unit tests to verify the correct functioning of the domain events, including publishing and subscribing mechanisms.
VarshaUN commented 1 week ago

Hi [@iluwatar , . I wanted to let you know that I am currently learning Data Structures and Algorithms (DSA) and have some prior knowledge in this area. I am ready and willing to contribute to any kind of issues, including simple documentation and typo errors. Looking forward to collaborating. I'm genuinely interested in contributing to your project. As a newbie, I would greatly appreciate any guidance you can provide to help me get started. Your support would mean a lot to me. Thank you, Varsha