From f2adaaead51f3526c41792a0b27fc2b56a51ca25 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 19 Dec 2018 16:37:45 +0100 Subject: [PATCH 1/7] Removed X2Software prefix in preparation for v1.0 --- Tapeti.Annotations/Tapeti.Annotations.nuspec | 2 +- Tapeti.DataAnnotations/Tapeti.DataAnnotations.nuspec | 4 ++-- Tapeti.Flow.SQL/Tapeti.Flow.SQL.nuspec | 6 +++--- Tapeti.Flow/Tapeti.Flow.nuspec | 6 +++--- Tapeti.Serilog/Tapeti.Serilog.nuspec | 4 ++-- Tapeti.SimpleInjector/Tapeti.SimpleInjector.nuspec | 4 ++-- Tapeti/Tapeti.nuspec | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Tapeti.Annotations/Tapeti.Annotations.nuspec b/Tapeti.Annotations/Tapeti.Annotations.nuspec index f804dca..68e8268 100644 --- a/Tapeti.Annotations/Tapeti.Annotations.nuspec +++ b/Tapeti.Annotations/Tapeti.Annotations.nuspec @@ -1,7 +1,7 @@ - X2Software.Tapeti.Annotations + Tapeti.Annotations $version$ Tapeti Annotations Mark van Renswoude diff --git a/Tapeti.DataAnnotations/Tapeti.DataAnnotations.nuspec b/Tapeti.DataAnnotations/Tapeti.DataAnnotations.nuspec index edd32a8..ddf90b8 100644 --- a/Tapeti.DataAnnotations/Tapeti.DataAnnotations.nuspec +++ b/Tapeti.DataAnnotations/Tapeti.DataAnnotations.nuspec @@ -1,7 +1,7 @@ - X2Software.Tapeti.DataAnnotations + Tapeti.DataAnnotations $version$ Tapeti DataAnnotations Mark van Renswoude @@ -14,7 +14,7 @@ rabbitmq tapeti dataannotations - + diff --git a/Tapeti.Flow.SQL/Tapeti.Flow.SQL.nuspec b/Tapeti.Flow.SQL/Tapeti.Flow.SQL.nuspec index adc8569..81a6fe0 100644 --- a/Tapeti.Flow.SQL/Tapeti.Flow.SQL.nuspec +++ b/Tapeti.Flow.SQL/Tapeti.Flow.SQL.nuspec @@ -1,7 +1,7 @@ - X2Software.Tapeti.Flow.SQL + Tapeti.Flow.SQL $version$ Tapeti Flow SQL Mark van Renswoude @@ -14,8 +14,8 @@ rabbitmq tapeti sql - - + + diff --git a/Tapeti.Flow/Tapeti.Flow.nuspec b/Tapeti.Flow/Tapeti.Flow.nuspec index ad1e5a9..27e8251 100644 --- a/Tapeti.Flow/Tapeti.Flow.nuspec +++ b/Tapeti.Flow/Tapeti.Flow.nuspec @@ -1,7 +1,7 @@ - X2Software.Tapeti.Flow + Tapeti.Flow $version$ Tapeti Flow Menno van Lavieren, Mark van Renswoude @@ -14,8 +14,8 @@ rabbitmq tapeti flow - - + + diff --git a/Tapeti.Serilog/Tapeti.Serilog.nuspec b/Tapeti.Serilog/Tapeti.Serilog.nuspec index 6e7bdcd..80c6cba 100644 --- a/Tapeti.Serilog/Tapeti.Serilog.nuspec +++ b/Tapeti.Serilog/Tapeti.Serilog.nuspec @@ -1,7 +1,7 @@ - X2Software.Tapeti.Serilog + Tapeti.Serilog $version$ Tapeti Serilog Hans Mulder @@ -14,7 +14,7 @@ rabbitmq tapeti simpleinjector serilog - + diff --git a/Tapeti.SimpleInjector/Tapeti.SimpleInjector.nuspec b/Tapeti.SimpleInjector/Tapeti.SimpleInjector.nuspec index c1ed9a3..8bfbe3d 100644 --- a/Tapeti.SimpleInjector/Tapeti.SimpleInjector.nuspec +++ b/Tapeti.SimpleInjector/Tapeti.SimpleInjector.nuspec @@ -1,7 +1,7 @@ - X2Software.Tapeti.SimpleInjector + Tapeti.SimpleInjector $version$ Tapeti SimpleInjector Mark van Renswoude @@ -14,7 +14,7 @@ rabbitmq tapeti simpleinjector - + diff --git a/Tapeti/Tapeti.nuspec b/Tapeti/Tapeti.nuspec index cc0d1c9..72e9360 100644 --- a/Tapeti/Tapeti.nuspec +++ b/Tapeti/Tapeti.nuspec @@ -1,7 +1,7 @@ - X2Software.Tapeti + Tapeti $version$ Tapeti Mark van Renswoude @@ -14,7 +14,7 @@ rabbitmq tapeti - + From 326574433059cc6ff1151f10eb6cac8078858e2b Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 19 Dec 2018 18:07:48 +0100 Subject: [PATCH 2/7] Fixed reference to renamed NuGet packages --- appveyor.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9fbce10..91f2568 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,17 +11,17 @@ before_build: after_build: - cmd: ECHO nuget pack Tapeti\Tapeti.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - cmd: nuget pack Tapeti\Tapeti.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - - cmd: appveyor PushArtifact "X2Software.Tapeti.%GitVersion_NuGetVersion%.nupkg" + - cmd: appveyor PushArtifact "Tapeti.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.Annotations\Tapeti.Annotations.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - - cmd: appveyor PushArtifact "X2Software.Tapeti.Annotations.%GitVersion_NuGetVersion%.nupkg" + - cmd: appveyor PushArtifact "Tapeti.Annotations.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.DataAnnotations\Tapeti.DataAnnotations.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - - cmd: appveyor PushArtifact "X2Software.Tapeti.DataAnnotations.%GitVersion_NuGetVersion%.nupkg" + - cmd: appveyor PushArtifact "Tapeti.DataAnnotations.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.Flow\Tapeti.Flow.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - - cmd: appveyor PushArtifact "X2Software.Tapeti.Flow.%GitVersion_NuGetVersion%.nupkg" + - cmd: appveyor PushArtifact "Tapeti.Flow.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.SimpleInjector\Tapeti.SimpleInjector.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - - cmd: appveyor PushArtifact "X2Software.Tapeti.SimpleInjector.%GitVersion_NuGetVersion%.nupkg" + - cmd: appveyor PushArtifact "Tapeti.SimpleInjector.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.Serilog\Tapeti.Serilog.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - - cmd: appveyor PushArtifact "X2Software.Tapeti.Serilog.%GitVersion_NuGetVersion%.nupkg" + - cmd: appveyor PushArtifact "Tapeti.Serilog.%GitVersion_NuGetVersion%.nupkg" assembly_info: patch: false From 2042cc074f3d6600fb16d3c710d27814477ef7ef Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 19 Dec 2018 21:40:53 +0100 Subject: [PATCH 3/7] Fixed incorrect assertion caused by fixing "code issues" (oh the irony) --- Tapeti.Flow/Default/FlowProvider.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tapeti.Flow/Default/FlowProvider.cs b/Tapeti.Flow/Default/FlowProvider.cs index 7115ae9..5a6a49a 100644 --- a/Tapeti.Flow/Default/FlowProvider.cs +++ b/Tapeti.Flow/Default/FlowProvider.cs @@ -56,11 +56,10 @@ namespace Tapeti.Flow.Default private async Task SendRequest(FlowContext context, object message, ResponseHandlerInfo responseHandlerInfo, string convergeMethodName = null, bool convergeMethodTaskSync = false) { - Debug.Assert(context.FlowState != null, "context.FlowState != null"); - if (context.FlowState == null) { await CreateNewFlowState(context); + Debug.Assert(context.FlowState != null, "context.FlowState != null"); } var continuationID = Guid.NewGuid(); From 525e83bde99b4704cb366f92fde7768073a9f554 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 19 Dec 2018 21:41:19 +0100 Subject: [PATCH 4/7] Implemented SQL flow repository --- Tapeti.Flow.SQL/ConfigExtensions.cs | 14 ++-- .../SqlConnectionFlowRepository.cs | 69 ++++++++++++------- Test/Program.cs | 5 +- 3 files changed, 53 insertions(+), 35 deletions(-) diff --git a/Tapeti.Flow.SQL/ConfigExtensions.cs b/Tapeti.Flow.SQL/ConfigExtensions.cs index 9dd039b..2e2e247 100644 --- a/Tapeti.Flow.SQL/ConfigExtensions.cs +++ b/Tapeti.Flow.SQL/ConfigExtensions.cs @@ -7,9 +7,9 @@ namespace Tapeti.Flow.SQL { public static class ConfigExtensions { - public static TapetiConfig WithFlowSqlRepository(this TapetiConfig config, string connectionString, int serviceId, string schema = "dbo") + public static TapetiConfig WithFlowSqlRepository(this TapetiConfig config, string connectionString, string tableName = "Flow") { - config.Use(new FlowSqlRepositoryBundle(connectionString, serviceId, schema)); + config.Use(new FlowSqlRepositoryBundle(connectionString, tableName)); return config; } } @@ -18,21 +18,19 @@ namespace Tapeti.Flow.SQL internal class FlowSqlRepositoryBundle : ITapetiExtension { private readonly string connectionString; - private readonly string schema; - private readonly int serviceId; + private readonly string tableName; - public FlowSqlRepositoryBundle(string connectionString, int serviceId, string schema) + public FlowSqlRepositoryBundle(string connectionString, string tableName) { this.connectionString = connectionString; - this.serviceId = serviceId; - this.schema = schema; + this.tableName = tableName; } public void RegisterDefaults(IDependencyContainer container) { - container.RegisterDefault(() => new SqlConnectionFlowRepository(connectionString, serviceId, schema)); + container.RegisterDefaultSingleton(() => new SqlConnectionFlowRepository(connectionString, tableName)); } diff --git a/Tapeti.Flow.SQL/SqlConnectionFlowRepository.cs b/Tapeti.Flow.SQL/SqlConnectionFlowRepository.cs index 4a8640c..d32b645 100644 --- a/Tapeti.Flow.SQL/SqlConnectionFlowRepository.cs +++ b/Tapeti.Flow.SQL/SqlConnectionFlowRepository.cs @@ -8,32 +8,28 @@ using Newtonsoft.Json; namespace Tapeti.Flow.SQL { /* - Assumes the following table layout (schema configurable): + Assumes the following table layout (table name configurable and may include schema): - create table shared.Flow + create table Flow ( FlowID uniqueidentifier not null, - ServiceID int not null, CreationTime datetime2(3) not null, StateJson nvarchar(max) null, constraint PK_Flow primary key clustered (FlowID) ); - go; */ public class SqlConnectionFlowRepository : IFlowRepository { private readonly string connectionString; - private readonly int serviceId; - private readonly string schema; + private readonly string tableName; - public SqlConnectionFlowRepository(string connectionString, int serviceId, string schema) + public SqlConnectionFlowRepository(string connectionString, string tableName = "Flow") { this.connectionString = connectionString; - this.serviceId = serviceId; - this.schema = schema; + this.tableName = tableName; } @@ -41,14 +37,7 @@ namespace Tapeti.Flow.SQL { using (var connection = await GetConnection()) { - var flowQuery = new SqlCommand($"select FlowID, StateJson from {schema}.Flow " + - "where ServiceID = @ServiceID ", - connection); - var flowServiceParam = flowQuery.Parameters.Add("@ServiceID", SqlDbType.Int); - - flowServiceParam.Value = serviceId; - - + var flowQuery = new SqlCommand($"select FlowID, StateJson from {tableName}", connection); var flowReader = await flowQuery.ExecuteReaderAsync(); var result = new List>(); @@ -67,21 +56,53 @@ namespace Tapeti.Flow.SQL } - public Task CreateState(Guid flowID, T state, DateTime timestamp) + public async Task CreateState(Guid flowID, T state, DateTime timestamp) { - //var stateJson = JsonConvert.SerializeObject(state); + using (var connection = await GetConnection()) + { + var query = new SqlCommand($"insert into {tableName} (FlowID, StateJson, CreationTime)" + + "values (@FlowID, @StateJson, @CreationTime)", + connection); - throw new NotImplementedException(); + var flowIDParam = query.Parameters.Add("@FlowID", SqlDbType.UniqueIdentifier); + var stateJsonParam = query.Parameters.Add("@StateJson", SqlDbType.NVarChar); + var creationTimeParam = query.Parameters.Add("@CreationTime", SqlDbType.DateTime2); + + flowIDParam.Value = flowID; + stateJsonParam.Value = JsonConvert.SerializeObject(state); + creationTimeParam.Value = timestamp; + + await query.ExecuteNonQueryAsync(); + } } - public Task UpdateState(Guid flowID, T state) + public async Task UpdateState(Guid flowID, T state) { - throw new NotImplementedException(); + using (var connection = await GetConnection()) + { + var query = new SqlCommand($"update {tableName} set StateJson = @StateJson where FlowID = @FlowID", connection); + + var flowIDParam = query.Parameters.Add("@FlowID", SqlDbType.UniqueIdentifier); + var stateJsonParam = query.Parameters.Add("@StateJson", SqlDbType.NVarChar); + + flowIDParam.Value = flowID; + stateJsonParam.Value = JsonConvert.SerializeObject(state); + + await query.ExecuteNonQueryAsync(); + } } - public Task DeleteState(Guid flowID) + public async Task DeleteState(Guid flowID) { - throw new NotImplementedException(); + using (var connection = await GetConnection()) + { + var query = new SqlCommand($"delete from {tableName} where FlowID = @FlowID", connection); + + var flowIDParam = query.Parameters.Add("@FlowID", SqlDbType.UniqueIdentifier); + flowIDParam.Value = flowID; + + await query.ExecuteNonQueryAsync(); + } } diff --git a/Test/Program.cs b/Test/Program.cs index caad2c9..be6eed9 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -5,6 +5,7 @@ using Tapeti.DataAnnotations; using Tapeti.Flow; using Tapeti.SimpleInjector; using System.Threading; +using Tapeti.Flow.SQL; namespace Test { @@ -12,10 +13,7 @@ namespace Test { private static void Main() { - // TODO SQL based flow store // TODO logging - // TODO uitzoeken of we consumers kunnen pauzeren (denk: SQL down) --> nee, EFDBContext Get Async maken en retryen? kan dat, of timeout dan Rabbit? - var container = new Container(); container.Register(); @@ -23,6 +21,7 @@ namespace Test container.Register(); var config = new TapetiConfig(new SimpleInjectorDependencyResolver(container)) + //.WithFlowSqlRepository("Server=localhost;Database=TapetiTest;Integrated Security=true") .WithFlow() .WithDataAnnotations() .RegisterAllControllers() From 9708c9880e8062b44c3050f57c9c2cb0d3f435ac Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 19 Dec 2018 21:58:50 +0100 Subject: [PATCH 5/7] Added Tapeti.Flow.SQL to AppVeyor build --- Tapeti.Serilog/Tapeti.Serilog.nuspec | 4 ++-- appveyor.yml | 2 ++ resources/icons/Tapeti.Flow.SQL.png | Bin 0 -> 6156 bytes resources/icons/Tapeti.Serilog.png | Bin 0 -> 6071 bytes 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 resources/icons/Tapeti.Flow.SQL.png create mode 100644 resources/icons/Tapeti.Serilog.png diff --git a/Tapeti.Serilog/Tapeti.Serilog.nuspec b/Tapeti.Serilog/Tapeti.Serilog.nuspec index 80c6cba..26fd39c 100644 --- a/Tapeti.Serilog/Tapeti.Serilog.nuspec +++ b/Tapeti.Serilog/Tapeti.Serilog.nuspec @@ -8,11 +8,11 @@ Hans Mulder https://raw.githubusercontent.com/MvRens/Tapeti/master/UNLICENSE https://github.com/MvRens/Tapeti - https://raw.githubusercontent.com/MvRens/Tapeti/master/resources/icons/Tapeti.SimpleInjector.png + https://raw.githubusercontent.com/MvRens/Tapeti/master/resources/icons/Tapeti.Serilog.png false Serilog integration package for Tapeti - rabbitmq tapeti simpleinjector serilog + rabbitmq tapeti serilog diff --git a/appveyor.yml b/appveyor.yml index 91f2568..bbf7f81 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,6 +18,8 @@ after_build: - cmd: appveyor PushArtifact "Tapeti.DataAnnotations.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.Flow\Tapeti.Flow.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - cmd: appveyor PushArtifact "Tapeti.Flow.%GitVersion_NuGetVersion%.nupkg" + - cmd: nuget pack Tapeti.Flow\SQL.Tapeti.Flow.SQL.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" + - cmd: appveyor PushArtifact "Tapeti.Flow.SQL.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.SimpleInjector\Tapeti.SimpleInjector.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - cmd: appveyor PushArtifact "Tapeti.SimpleInjector.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.Serilog\Tapeti.Serilog.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" diff --git a/resources/icons/Tapeti.Flow.SQL.png b/resources/icons/Tapeti.Flow.SQL.png new file mode 100644 index 0000000000000000000000000000000000000000..eacf05f946df5fef952ee391574539cceaca47b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gZ@Zl@&`G?ORd+4j}sSvwD@~w9@E_i5k($Xz|()E;~r=NcA zkb(XIF(Brb_y$q&NOg8&;W4L>{AD4Na>z%RjI*?)%=% xfUSpYyY{D>f4r%Nx5iuJt?|})1CRd`U;v{B%ZObvNJIbt002ovPDHLkV1oLuoecm0 literal 0 HcmV?d00001 From c5f2c4ba89ace3b5c1e4db0266328f50c84d64aa Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 19 Dec 2018 22:17:04 +0100 Subject: [PATCH 6/7] Typo in AppVeyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index bbf7f81..d2d5812 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,7 +18,7 @@ after_build: - cmd: appveyor PushArtifact "Tapeti.DataAnnotations.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.Flow\Tapeti.Flow.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - cmd: appveyor PushArtifact "Tapeti.Flow.%GitVersion_NuGetVersion%.nupkg" - - cmd: nuget pack Tapeti.Flow\SQL.Tapeti.Flow.SQL.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" + - cmd: nuget pack Tapeti.Flow.SQL\Tapeti.Flow.SQL.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - cmd: appveyor PushArtifact "Tapeti.Flow.SQL.%GitVersion_NuGetVersion%.nupkg" - cmd: nuget pack Tapeti.SimpleInjector\Tapeti.SimpleInjector.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%" - cmd: appveyor PushArtifact "Tapeti.SimpleInjector.%GitVersion_NuGetVersion%.nupkg" From 91ce1555d5bb694421991e6af417164a7b6879cd Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Fri, 21 Dec 2018 10:49:30 +0100 Subject: [PATCH 7/7] Fixed NRE with async methods returning a message --- Tapeti/Default/PublishResultBinding.cs | 10 ++++++++++ Test/MarcoController.cs | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Tapeti/Default/PublishResultBinding.cs b/Tapeti/Default/PublishResultBinding.cs index 38d5ff8..d02d087 100644 --- a/Tapeti/Default/PublishResultBinding.cs +++ b/Tapeti/Default/PublishResultBinding.cs @@ -38,6 +38,16 @@ namespace Tapeti.Default } + + // ReSharper disable once UnusedMember.Local - used implicitly above + private static async Task PublishGenericTaskResult(IMessageContext messageContext, object value) where T : class + { + var message = await (Task)value; + if (message != null) + await Reply(message, messageContext); + } + + private static Task Reply(object message, IMessageContext messageContext) { var publisher = (IInternalPublisher)messageContext.DependencyResolver.Resolve(); diff --git a/Test/MarcoController.cs b/Test/MarcoController.cs index da2ddab..4ced01e 100644 --- a/Test/MarcoController.cs +++ b/Test/MarcoController.cs @@ -120,9 +120,10 @@ namespace Test * This will automatically include the correlationId in the response and * use the replyTo header of the request if provided. */ - public PoloConfirmationResponseMessage PoloConfirmation(PoloConfirmationRequestMessage message) + public async Task PoloConfirmation(PoloConfirmationRequestMessage message) { Console.WriteLine(">> PoloConfirmation (returning confirmation)"); + await Task.Delay(100); return new PoloConfirmationResponseMessage {