Distributed transaction using Saga

Hi,
Im trying to manage a distributed transaction using saga. My design is like below.

Order service start saga with CreateOrder command.
Then it gets ItemAddCommands.
And finally it gets ConfirmOrderCommand, in this step it create event called CreditRequestedEvent and publish it to RabbitMQ.
Then Customer service process this event. And then it publish another event called CreditConfirmedEvent and it is processed by the Order service and ends the saga.

Is this kind of implementation ok. And this Customer serivice can be a . Net service.

If you use axon-distributed-commandbus-springcloud module and axon-amqp module,axon will publish the events into amqp queue. Then in your .NET service, you can get it and process, send another event into some queue. And in axon service, get event from this queue and process.

在 2018年6月6日星期三 UTC+8上午10:26:40,Kasun Sameera写道:

Thanks.
Do you have sample configuration of 'axon-distributed-commandbus-springcloud`.

It is a maven module, you just add it in pom file, axon will configure some default for you, like distributed command bus, and dispatch event to AMQP. But you need to configure:

  1. exchange/binding/queue of amqp.

  2. Configure a SpringAMQPMessageSource to listen some queue, related with that queue in step1.

  3. Set event handler to use some event processor, with @ProcessingGroup,

  4. Set the processor(step 3) to use the message source(step 2) to get events.

Iam just trying to use axon, not a export, please correct me if I am wrong. I come up with that from the video. You can get the detail code and explain from that video.

Your Order Service is holding the saga ?
You need to create CreditRequestedEvent

This even will go to another service called Customer Service and put back a event Queue.

This event need to translate to CreditConfirmedEvent in Order Service.

These two events are duplicated in both the service ?