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

后端 未结 3 1468
既然无缘
既然无缘 2021-02-03 18:00

Jimmy Boagard describes a McDonalds fast food chain here comparing it to a scatter gather pattern.

Workflow image stolen from above article:

Initial Im

3条回答
  •  时光说笑
    2021-02-03 18:57

    Couldn't you "simply" pass the object along in the queue, as an event parameter? When the saga listener gets an "order completed" Event it would contain the object that is completed in the event?

    I imagine it being sent to the queue via a Generic method, where the object must implement IFoodOrdered

    Then you can on the implement a virtual method that the saga can use to do the "generic" thing when it's picked up, and you only have to implement overloads for those special items, that require something special to happen?

提交回复
热议问题