Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

E2E Testing Basket and Ordering Microservices Event Source Mapping Polling Invocations

Pragya Keshap answered on February 13, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • E2E Testing Basket and Ordering Microservice
  • E2E Testing Basket and Ordering Microservices Sync & Async Invocations
  • Developing AWS SQS Event Source Mapping Polling Invocation from Ordering Microservice

  • E2E Testing Basket and Ordering Microservices Event Source Mapping Polling Invocations

    0

    Forces

    2PC is not an option

    If the database transaction commits messages must be sent. Conversely, if the database rolls back, the messages must not be sent

    Messages must be sent to the message broker in the order they were sent by the service. This ordering must be preserved across multiple service instances that update the same aggregate.

    Solution

    A good solution to this problem is to use event sourcing. Event sourcing persists the state of a business entity such an Order or a Customer as a sequence of state-changing events. Whenever the state of a business entity changes, a new event is appended to the list of events. Since saving an event is a single operation, it is inherently atomic. The application reconstructs an entity’s current state by replaying the events.

    Applications persist events in an event store, which is a database of events. The store has an API for adding and retrieving an entity’s events. The event store also behaves like a message broker. It provides an API that enables services to subscribe to events. When a service saves an event in the event store, it is delivered to all interested subscribers.

    Some entities, such as a Customer, can have a large number of events. In order to optimize loading, an application can periodically save a snapshot of an entity’s current state. To reconstruct the current state, the application finds the most recent snapshot and the events that have occurred since that snapshot. As a result, there are fewer events to replay.

    https://microservices.io/patterns/data/event-sourcing.html

    Popularity 1/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 13 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.