-
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the ordering of message flushing and marten transactions to acc…
…omodate After() methods. Closes GH-1083
- Loading branch information
1 parent
2e02283
commit aadff61
Showing
106 changed files
with
142 additions
and
4,788 deletions.
There are no files selected for viewing
77 changes: 0 additions & 77 deletions
77
...ttp.Tests/Internal/Generated/WolverineHandlers/POST_api_tenants_tenant_counters_id_inc.cs
This file was deleted.
Oops, something went wrong.
78 changes: 0 additions & 78 deletions
78
...tp.Tests/Internal/Generated/WolverineHandlers/POST_api_tenants_tenant_counters_id_inc2.cs
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
src/Http/Wolverine.Http.Tests/publishing_messages_from_middleware.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Alba; | ||
using Shouldly; | ||
using Wolverine.Tracking; | ||
using WolverineWebApi; | ||
|
||
namespace Wolverine.Http.Tests; | ||
|
||
public class publishing_messages_from_middleware : IntegrationContext | ||
{ | ||
public publishing_messages_from_middleware(AppFixture fixture) : base(fixture) | ||
{ | ||
} | ||
|
||
[Fact] | ||
public async Task receive_messages_from_before_and_after_middleware() | ||
{ | ||
Func<IMessageContext, Task> execute = async c => | ||
{ | ||
await Host.Scenario(x => | ||
{ | ||
x.Post.Url("/middleware-messages/leia"); | ||
}); | ||
}; | ||
|
||
var tracked = await Host | ||
.TrackActivity() | ||
.WaitForMessageToBeReceivedAt<AfterMessage1>(Host) | ||
.ExecuteAndWaitAsync(execute); | ||
|
||
tracked.Received.SingleMessage<BeforeMessage1>() | ||
.Name.ShouldBe("leia"); | ||
|
||
tracked.Received.SingleMessage<AfterMessage1>() | ||
.Name.ShouldBe("leia"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Diagnostics; | ||
using Marten; | ||
using Wolverine; | ||
using Wolverine.Attributes; | ||
using Wolverine.Http; | ||
|
||
namespace WolverineWebApi; | ||
|
||
public static class CascadingEndpoint | ||
{ | ||
public static OutgoingMessages Before(string name) | ||
{ | ||
return [new BeforeMessage1(name)]; | ||
} | ||
|
||
[Transactional] | ||
[WolverinePost("/middleware-messages/{name}")] | ||
public static string Post(string name, IDocumentSession session) | ||
{ | ||
return "Hey"; | ||
} | ||
|
||
public static async Task After(IMessageBus bus, string name) | ||
{ | ||
await bus.PublishAsync(new AfterMessage1(name)); | ||
} | ||
} | ||
|
||
public record BeforeMessage1(string Name); | ||
public record AfterMessage1(string Name); | ||
|
||
public static class MiddlewareMessageHandler | ||
{ | ||
public static void Handle(BeforeMessage1 message) => Debug.WriteLine("Got " + message); | ||
public static void Handle(AfterMessage1 message) => Debug.WriteLine("Got " + message); | ||
} |
32 changes: 0 additions & 32 deletions
32
...tp/WolverineWebApi/Internal/Generated/WolverineHandlers/CustomRequestHandler1116913013.cs
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/DELETE_api_trainer.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.