Skip to content

Event-carried state transfer pattern #2434

Description

@javatlacati

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.

Activity

  1. changed the title [-]event-carried state transfer[/-] [+]Event-carried state transfer pattern[/+] on Jan 6, 2023
  2. rahul-raj commented on Feb 5, 2023

    @rahul-raj
    Contributor

    @iluwatar
    I can work on this.

  3. moved this from Todo to In Progress in Java Design Patterns projecton Feb 18, 2023
  4. stale commented on Apr 19, 2023

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

  5. added
    status: staleissues and pull requests that have not had recent interaction
    on Apr 19, 2023
  6. moved this from In Progress to Todo in Java Design Patterns projecton Mar 24, 2024
  7. removed
    status: staleissues and pull requests that have not had recent interaction
    on Jun 1, 2024
  8. github-actions commented on Jan 7, 2025

    @github-actions

    This issue is stale because it has been open 60 days with no activity.

  9. ylcn91 commented on Sep 3, 2026

    @ylcn91
    Contributor

    Hi @iluwatar, I picked this one up. Full-state events, a version-guarded consumer replica, a consumer that keeps working while the producer is offline, plus tests, README and class diagram are in #3602. Happy to adjust anything in review.

  10. moved this from Todo to In Progress in Java Design Patterns projecton Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions