Questions tagged [saga]

A pattern that enables a service bus to deal with long-running processes, fault tolerance and scalability.

Long-running business processes exist in many systems. Whether the steps are automated, manual, or a combination, effective handling of these processes is critical.

NServiceBus employs event-driven architectural principles to bake fault-tolerance and scalability into these processes.

The Saga is a pattern that addresses these challenges uncovered by the relational database community years ago, packaged in NServiceBus for ease of use by developers.

MassTransit supports sagas, and Automatonymous is a saga implementation built on top of MassTransit.

372 questions
44
votes
3 answers

How to implement a saga using a scatter/Gather pattern In MassTransit 3.0

Jimmy Boagard describes a McDonalds fast food chain here comparing it to a scatter gather pattern. Workflow image stolen from above article: Initial Implementation Thoughts: To have a common interface for all of the types of FoodOrdered events…
Ashtonian
  • 4,088
  • 2
  • 16
  • 24
35
votes
1 answer

2PC vs Sagas (distributed transactions)

I'm developing my insight about distributed systems, and how to maintain data consistency across such systems, where business transactions covers multiple services, bounded contexts and network boundaries. Here are two approaches which I know are…
Tuomas Toivonen
  • 15,414
  • 22
  • 98
  • 170
18
votes
3 answers

CQRS sagas - did I understand them right?

I'm trying to understand sagas, and meanwhile I have a specific way of thinking of them - but I am not sure whether I got the idea right. Hence I'd like to elaborate and have others tell me whether it's right or wrong. In my understanding, sagas are…
Golo Roden
  • 112,924
  • 78
  • 260
  • 376
13
votes
2 answers

How to test redux-saga delay

Problem In redux-saga, I am using yield delay(1000);. During my unit test, I do expect(generator.next().value).toEqual(delay(1000));. I expect the test to pass. This is my sagas.js: import { delay } from 'redux-saga'; export function*…
Dimitri Kopriwa
  • 8,478
  • 12
  • 70
  • 140
12
votes
2 answers

DDD, difference between a Saga and an Event Dispatcher?

On multiple sites (e.g. here or here Sagas are described as a mechanism that listens to domain events and reacts to them, executing new commands, and finally modifying the domain, etc. Is there any difference between a Saga and a simple event…
fj123x
  • 4,958
  • 11
  • 39
  • 55
9
votes
2 answers

Implementing sagas with Kafka

I am using Kafka for Event Sourcing and I am interested in implementing sagas using Kafka. Any best practices on how to do this? The Commander pattern mentioned here seems close to the architecture I am trying to build but sagas are not mentioned…
George
  • 193
  • 1
  • 8
8
votes
3 answers

react native app works on debug mode, but not works release mode on ios

I Have an app on react native. Debug mode works on ios. But Release mode not works. I tried change the optimization level but not helped. The problem that I don't see any error. Just not working some functional. And I can't debug release version of…
Kamil Ibadov
  • 1,985
  • 1
  • 17
  • 40
7
votes
1 answer

Time based Sagas with Event Sourcing

Let's say I wanted to have a saga that get's created by some event, then sits and wait for a few hours, and if nothing happens, sends off some command. Now, if this Saga was all in-memory and I had to restart the app/server, the saga would be…
Kristoffer Lindvall
  • 2,614
  • 1
  • 15
  • 27
7
votes
2 answers

Microservices Saga pattern consumer awaits response

I would like to clarify what'd be the best way of organizing architecture. I've got rest api and microservices architecture. I have applied the Database per Service pattern. So let's imagine that the user wants to create an order(an e-commerce…
7
votes
2 answers

Message broker exception handling in session transacted consumer or producer

I want to use SAGA pattern in my Spring Boot Microservices. For example in order of customer, when the order created, an event like OrderCreatedEvent produced and then in customer microservice the listener on OrderCreatedEvent Update the customer…
mohammad_1m2
  • 1,281
  • 3
  • 18
  • 32
6
votes
1 answer

setTimeout function in saga React.js

I just want to hide Undo Button in UI after 5 seconds. Here is my code: Saga.js function* updateActionListingsSaga({ payload }) { try { const res = yield call(updateUnpublishedListingsById, payload); let unpublishedListings = yield…
Hassam Saeed
  • 530
  • 3
  • 14
6
votes
2 answers

Redux saga: What is the difference between using yield call() and async/await?

I'm using a Redux Saga template and it uses generator functions that contain instances of yield call(). Basically it looks like this: function *a(){ yield call(); } yield takeLatest(SOME_ACTION, a) My questions are as follows: 1)…
gkeenley
  • 2,920
  • 1
  • 18
  • 45
6
votes
3 answers

Distributed transactions in microservices

I have 2 microservices S1 and S2. S1 invokes S2 to update a data and then S1 inserts another data,But let's consider S1 fails,Then we need to rollback the data updated by S2 or else we'll be in inconsistent state. I also gone through Saga…
Ragavan
  • 81
  • 8
6
votes
1 answer

EventSourced Saga Implementation

I have written an Event Sourced Aggregate and now implemented an Event Sourced Saga... I have noticed the two are similair and created an event sourced object as a base class from which both derive. I have seen one demo here…
morleyc
  • 2,228
  • 9
  • 35
  • 85
5
votes
1 answer

Saga Orchestration Scability Issue in Microservice Architecture

I need to handle distributed transactions in a microservice architecture. In theory, one of the best ways of doing that is using the Saga Orchestration pattern. The problem is I could not find any detailed information about how to provide…
Barış Velioğlu
  • 5,243
  • 14
  • 54
  • 97
1
2 3
24 25