eventuate-tram / eventuate-tram-sagas-examples-customers-and-orders

Spring Boot/JPA microservices that use an orchestration-based saga to maintain data consistency
Other
531 stars 240 forks source link

I don't think it's need distributed transaction in this case #9

Open WestCoastBaby opened 5 years ago

WestCoastBaby commented 5 years ago

It just involved two service,and Customer-Server don't need to excute DQL.It is my understanding that 2 or more database need to execute DQL than we need distributed transaction. Furthermore,If I need compensate and action in every step,and there are over 2 step.What am I supposed to write SagaDefinition like below?

private SagaDefinition<CreateOrderSagaData> sagaDefinition = step() .withCompensation(this::reject) .step() .invokeParticipant(this::reserveCredit) .step() .invokeParticipant(this::approve) .build();

WestCoastBaby commented 5 years ago

I figure out the second Q,(#^.^#) image