ThreeDotsLabs / watermill

Building event-driven applications the easy way in Go.
https://watermill.io
MIT License
7.13k stars 383 forks source link

Sagas support #7

Open roblaszczak opened 5 years ago

vikstrous commented 4 years ago

What are your thoughts on how sagas should work with watermill? It seems to me that it's pretty simple to implement a choreograpy based saga using the existing features of watermill. To implement an orchestration based saga, wouldn't you just not use watermill at all? Doesn't it make more sense to implement an orchestration based saga by just creating a service that stores its state in a database (or even filesystem) and logs its progress there without the need for events or pub/sub or anything fancy?

roblaszczak commented 3 years ago

@czeslavo prepared a pretty nice example of Process Manager implementation with Watermill here: https://github.com/czeslavo/process-manager. It's not Saga, but it's pretty similar and with some additions, you may implement saga in a pretty simple way.

Anyway, it would be good to have some tooling in Watermill to support it more out-of-the-box - and this is the long term plan ;-)