Different way to start a Saga

Hi,

I receive big payload via REST API. Then I send command via command gateway and in aggregate I hadle the command and publish an event which trigers a saga which processes the payload from REST API.
The problem is that the payload received from REST API is strored with the event which I want to avoid. Could you please suggest how to run the saga without polluting the event store with the payload from REST API?

Thanks

Pavel

Hi Pavel,

everything really depends on what you’re trying to achieve. Is the rest call big because of data not (yet) needed, or does it contain large binary data?
In the latter case, we recommend storing the binary data somewhere first, and just including a reference to the data in the event. Handler can then retrieve the data using this reference.

If you have data in your rest payload that is needed at some later time, perhaps the Saga is not the best solution to your problem. Sometimes, a process is easier to be implemented as a “procedure” of commands being sent as a result of the previous command’s success.

Cheers,

Allard

Hi Allard,

thanks for the answer. I was thinking of the same approach i.e. saving the data somewhere and then pass the reference in the event

Cheers

Pavel

Dne úterý 20. listopadu 2018 15:44:13 UTC+1 Allard Buijze napsal(a):