From d963fc6d46a6447b8e843a437257a6eece92344b Mon Sep 17 00:00:00 2001 From: Tomasz Maruszak Date: Wed, 16 Oct 2024 22:51:55 +0200 Subject: [PATCH] SlimMessageBus.Host.Outbox.Memory that deffers sending of messages until unit of work commits Signed-off-by: Tomasz Maruszak --- build/tasks.ps1 | 1 + .../SlimMessageBus.Host.Outbox.DbContext.csproj | 1 - .../Configuration/MemoryOutboxSettings.cs | 6 ++++++ .../SlimMessageBus.Host.Outbox.Memory.csproj | 14 ++++++++++++++ src/SlimMessageBus.sln | 13 ++++++++++++- 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 src/SlimMessageBus.Host.Outbox.Memory/Configuration/MemoryOutboxSettings.cs create mode 100644 src/SlimMessageBus.Host.Outbox.Memory/SlimMessageBus.Host.Outbox.Memory.csproj diff --git a/build/tasks.ps1 b/build/tasks.ps1 index e8a76c4b..14da429c 100644 --- a/build/tasks.ps1 +++ b/build/tasks.ps1 @@ -40,6 +40,7 @@ $projects = @( "SlimMessageBus.Host.Outbox", "SlimMessageBus.Host.Outbox.DbContext", + "SlimMessageBus.Host.Outbox.Memory", "SlimMessageBus.Host.Outbox.Sql", "SlimMessageBus.Host.Outbox.Sql.DbContext", diff --git a/src/SlimMessageBus.Host.Outbox.DbContext/SlimMessageBus.Host.Outbox.DbContext.csproj b/src/SlimMessageBus.Host.Outbox.DbContext/SlimMessageBus.Host.Outbox.DbContext.csproj index 2fc6937b..54a42d11 100644 --- a/src/SlimMessageBus.Host.Outbox.DbContext/SlimMessageBus.Host.Outbox.DbContext.csproj +++ b/src/SlimMessageBus.Host.Outbox.DbContext/SlimMessageBus.Host.Outbox.DbContext.csproj @@ -17,5 +17,4 @@ - diff --git a/src/SlimMessageBus.Host.Outbox.Memory/Configuration/MemoryOutboxSettings.cs b/src/SlimMessageBus.Host.Outbox.Memory/Configuration/MemoryOutboxSettings.cs new file mode 100644 index 00000000..1d35c56a --- /dev/null +++ b/src/SlimMessageBus.Host.Outbox.Memory/Configuration/MemoryOutboxSettings.cs @@ -0,0 +1,6 @@ +namespace SlimMessageBus.Host.Outbox.Memory; + +public class MemoryOutboxSettings +{ + +} diff --git a/src/SlimMessageBus.Host.Outbox.Memory/SlimMessageBus.Host.Outbox.Memory.csproj b/src/SlimMessageBus.Host.Outbox.Memory/SlimMessageBus.Host.Outbox.Memory.csproj new file mode 100644 index 00000000..70c61041 --- /dev/null +++ b/src/SlimMessageBus.Host.Outbox.Memory/SlimMessageBus.Host.Outbox.Memory.csproj @@ -0,0 +1,14 @@ + + + + + + Plugin for SlimMessageBus that adds Outbox pattern support that deffers message delivery until transaction commits. Messages are buffered in memory. + SlimMessageBus MessageBus Outbox Memory + + + + + + + diff --git a/src/SlimMessageBus.sln b/src/SlimMessageBus.sln index fc7fd678..1744daec 100644 --- a/src/SlimMessageBus.sln +++ b/src/SlimMessageBus.sln @@ -279,7 +279,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nats-SingleNode", "Nats-Sin EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SlimMessageBus.Host.AspNetCore.Test", "Tests\SlimMessageBus.Host.AspNetCore.Test\SlimMessageBus.Host.AspNetCore.Test.csproj", "{9FCBF788-1F0C-43E2-909D-1F96B2685F38}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SlimMessageBus.Host.Outbox.DbContext", "SlimMessageBus.Host.Outbox.DbContext\SlimMessageBus.Host.Outbox.DbContext.csproj", "{3373FC58-73A7-46E6-9CB9-0858660EAD52}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SlimMessageBus.Host.Outbox.DbContext", "SlimMessageBus.Host.Outbox.DbContext\SlimMessageBus.Host.Outbox.DbContext.csproj", "{3373FC58-73A7-46E6-9CB9-0858660EAD52}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SlimMessageBus.Host.Outbox.Memory", "SlimMessageBus.Host.Outbox.Memory\SlimMessageBus.Host.Outbox.Memory.csproj", "{D0CC7072-1E1B-4FCA-A253-630035757FA2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -857,6 +859,14 @@ Global {3373FC58-73A7-46E6-9CB9-0858660EAD52}.Release|Any CPU.Build.0 = Release|Any CPU {3373FC58-73A7-46E6-9CB9-0858660EAD52}.Release|x86.ActiveCfg = Release|Any CPU {3373FC58-73A7-46E6-9CB9-0858660EAD52}.Release|x86.Build.0 = Release|Any CPU + {D0CC7072-1E1B-4FCA-A253-630035757FA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0CC7072-1E1B-4FCA-A253-630035757FA2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0CC7072-1E1B-4FCA-A253-630035757FA2}.Debug|x86.ActiveCfg = Debug|Any CPU + {D0CC7072-1E1B-4FCA-A253-630035757FA2}.Debug|x86.Build.0 = Debug|Any CPU + {D0CC7072-1E1B-4FCA-A253-630035757FA2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0CC7072-1E1B-4FCA-A253-630035757FA2}.Release|Any CPU.Build.0 = Release|Any CPU + {D0CC7072-1E1B-4FCA-A253-630035757FA2}.Release|x86.ActiveCfg = Release|Any CPU + {D0CC7072-1E1B-4FCA-A253-630035757FA2}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -941,6 +951,7 @@ Global {5250E48D-36C7-4214-8D7E-5924A9E337C6} = {59F88FB5-6D19-4520-87E8-227B3539BBB3} {9FCBF788-1F0C-43E2-909D-1F96B2685F38} = {9F005B5C-A856-4351-8C0C-47A8B785C637} {3373FC58-73A7-46E6-9CB9-0858660EAD52} = {B7CDA0D2-98AB-42B6-A41A-9D893C1B9DCB} + {D0CC7072-1E1B-4FCA-A253-630035757FA2} = {B7CDA0D2-98AB-42B6-A41A-9D893C1B9DCB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {435A0D65-610C-4B84-B1AA-2C7FBE72DB80}