Skip to content

Version 3.0.0 doesn't properly handle Published events in ExecuteAndWaitForSent method #18

@pelikak

Description

@pelikak

Hello @jbogard!

I have a problem with v3.0.0 of this package (I am using NServiceBus v8.0.0).
The ExecuteAndWaitForSent doesn't properly handle published events. I suppose there is a missing case in ExecuteAndWait method.
For now I created workaround adding ExecuteAndWaitForPublish method with the missing bit:

case "NServiceBus.Diagnostics.PublishMessage":
    var outgoingContext = activitySource.GetTagItem("testing.outgoing.message.context") as IOutgoingLogicalMessageContext;

    outgoingMessageContexts.Add(outgoingContext);

    if (outgoingContext is TMessageContext ctx2 && predicate(ctx2))
    {
        messageReceivingTaskSource.SetResult(null);
    }

    break;

It would be great if you find a time to fix it.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions