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

后端 未结 3 1842
借酒劲吻你
借酒劲吻你 2021-02-03 18:13

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:41

    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?

提交回复
热议问题