iluwatar / iluwatar/java-design-patterns

Event-carried state transfer pattern

Open
#2,434 4 comments 0 reactions 1 assignee View on GitHub

@ylcn91 is already working on this.

Since Sep 7, 2026.

epic: pattern type: feature
Dominant language
Java
Stars
94.7k
Forks
27.4k
Avg merge
3d 4h
Merged PRs (30d)
10

Description

Description:

The Event-Carried State Transfer (ECST) design pattern is a fundamental approach in event-driven architecture where state changes are encapsulated within events and propagated to other components. This pattern allows decoupled services to react to and act upon the state contained within these events, promoting a more scalable and resilient system. Implementing this pattern involves capturing state changes, creating events that carry this state, and ensuring that consuming services can process and utilize this state efficiently.

Key Elements of the Pattern:

  1. Stateful Events: Events must carry all necessary state information.
  2. Event Creation: Services create events upon state changes.
  3. Event Consumption: Other services subscribe to and process these events to update their own state or trigger further actions.
  4. Decoupling: Ensures that services remain loosely coupled, improving scalability and maintainability.
  5. Resilience: Improves system resilience by allowing services to recover state from events.
References:
  1. Stateful Event Pattern
  2. The Event-Carried State Transfer Pattern
  3. Decoding Event-Driven Architecture
  4. Event-Driven Architecture by Martin Fowler
  5. Name Your Event-Driven Architecture Design Patterns
Acceptance Criteria:
  1. Create a service that emits events containing the full state whenever a significant state change occurs.
  2. Implement a consumer service that subscribes to these events and updates its own state based on the event data.
  3. Demonstrate decoupled interaction between the services through event propagation and state transfer in a sample application.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.