How to trigger an event in the saga itself

195 views
Skip to first unread message

Marcelo Dias

unread,
Nov 26, 2020, 1:46:57 PM11/26/20
to masstransit-discuss
Hello everyone

I need to trigger an event within a task in the saga itself, its possible?? thanks
saga_error.PNG

Chris Patterson

unread,
Nov 26, 2020, 2:39:47 PM11/26/20
to masstrans...@googlegroups.com
Call publish?

Or, in some cases, you may be able to just call await this.RaiseEvent(context.Instance, new SomeMessage???) though I don't encourage that approach.


--
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/bef6ead1-a9df-4e0a-8e9a-345374afea55n%40googlegroups.com.

Mark Dawson

unread,
Nov 27, 2020, 12:28:05 PM11/27/20
to masstransit-discuss
I've successfully used Publish from inside a saga workflow with a message that is consumed by the saga itself.
I'd recommend you use the InMemoryOutbox on the saga configuration if you have any form of database backed saga repository - it avoids the message being consumed by the saga before the workflow thread that published it has finished processing :)

Reply all
Reply to author
Forward
0 new messages