InMemoryOutbox, Sagas and Request/Reply client

52 views
Skip to first unread message

Kenneth Avner

unread,
Jan 17, 2018, 7:18:04 AM1/17/18
to masstransit-discuss
Hello,

I am running MT v3.5.4 and I am having an issue when trying to apply .UseInMemoryOutbox on the saga endpoint.
The saga is using a mix of ThenAsync and Then calls, where one of them is running a request-reply client awaiting the result (I know.. But thats how it is just now).

What I see is that the task from the ThenAsync call is not awaited before the saga consumption is ended and the pipe "rolls back" to the InMemoryOutboxFilter.
This results in messages sent in the last ThenAsync call are never processed, as the list of tasks is empty when the InMemoryOutboxFilter wants to execute them. No exceptions observed.

There are no issues with awaiting tasks on our side.

I have tried replacing the ThenAsync call with a Then call (wrapping the request reply client) and then using .Wait() on the task returned from Send on that client. This seems to "solve" the problem.

Is this related to a known bug in the version I am using?

Thanks,

Kenneth A

Alexey Zimarev

unread,
Jan 17, 2018, 12:40:28 PM1/17/18
to masstransit-discuss
I have never seen this but in fact the saga has .Request, why just no use this, it is a native feature, which is in fact a saga in itself. Works very well.

Chris Patterson

unread,
Jan 19, 2018, 11:27:41 AM1/19/18
to masstrans...@googlegroups.com
With in-memory out box, you can't await a request client, you need to use the request feature of the saga.


On Wed, Jan 17, 2018 at 9:40 AM, Alexey Zimarev <azim...@gmail.com> wrote:
I have never seen this but in fact the saga has .Request, why just no use this, it is a native feature, which is in fact a saga in itself. Works very well.

--
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-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/7b8bc671-4e00-4c1c-a82e-33fb0f7b74f0%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Kenneth Avner

unread,
Jan 20, 2018, 2:08:11 PM1/20/18
to masstransit-discuss
Ok, thanks! That explains the fuzz I guess. Just out of plain curiosity; What mechanisms causes the framework to "ignore" the pending task created by the "regular" client in this case?

I am of course fully aware of the negative effects of blocking the saga instance when using the reqrep client and not the integrated saga version. I just did not even know the saga supported reqrep until this point, and changing this requires a database migration which is a nono just now.

Chris Patterson

unread,
Jan 21, 2018, 11:37:20 AM1/21/18
to masstrans...@googlegroups.com
Because the InMemoryOutbox won't send the request until the saga completes, making it essentially waiting for something that will never happen.

On Sat, Jan 20, 2018 at 11:08 AM, Kenneth Avner <ken...@avner.no> wrote:
Ok, thanks! That explains the fuzz I guess. Just out of plain curiosity; What mechanisms causes the framework to "ignore" the pending task created by the "regular" client in this case?

I am of course fully aware of the negative effects of blocking the saga instance when using the reqrep client and not the integrated saga version. I just did not even know the saga supported reqrep until this point, and changing this requires a database migration which is a nono just now.
--
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-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages