InitiatedBy or Orchestrates

21 views
Skip to first unread message

Wiebe

unread,
Nov 3, 2020, 5:24:43 PM11/3/20
to masstransit-discuss
Hi,

In a non-automatonymous saga, I'm trying to do a simple aggregate (count) of some messages with a timeout, so I want to initiate the saga on the first message, after that I want the saga to orchestrate that same message. 

I can't seem to find how to do this, InitiatedBy<T> doesn't work after the first message, and Orchestrates<T> doesn't initiate the saga. 

It's fine if it retries on concurrency exceptions.

I figured this policy should work: NewOrExistingSagaPolicy, but I can't seem to find how to apply it to a basic saga.  

I'm using MongoDb saga persistence.



Chris Patterson

unread,
Nov 3, 2020, 6:39:50 PM11/3/20
to masstrans...@googlegroups.com
I don't think that policy is available for consumer sagas, there is not an INitiateByOrOrchestrates.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/3c7bd3e6-a49e-4112-aabf-74f6ebdd379bn%40googlegroups.com.

Wiebe

unread,
Nov 4, 2020, 10:03:17 AM11/4/20
to masstransit-discuss
Thanks! So is there any way I can have the same message "start or continue" a saga? Or do I have to switch to automatonymous?

Chris Patterson

unread,
Nov 4, 2020, 11:04:12 AM11/4/20
to masstrans...@googlegroups.com
There isn't currently with consumer sagas, you'd need to use the state machine for that policy.

Wiebe

unread,
Nov 4, 2020, 11:18:57 AM11/4/20
to masstransit-discuss
That's too bad, like the simplicity of the consumer saga's... Thanks!

Chris Patterson

unread,
Nov 4, 2020, 1:47:23 PM11/4/20
to masstrans...@googlegroups.com
A new interface could be added, along with the mapping to the right policy. You're welcome to submit a PR to add it :)


Chris Patterson

unread,
Nov 19, 2020, 3:39:45 PM11/19/20
to masstrans...@googlegroups.com

Wiebe

unread,
Nov 20, 2020, 4:55:02 PM11/20/20
to masstransit-discuss
That's perfect, thank you so much!

I tried to take a shot at it but failed as it took me a bit too much time to figure out the internals :(

Wiebe

Chris Patterson

unread,
Nov 20, 2020, 7:47:27 PM11/20/20
to masstrans...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages