diff --git a/build.cake b/build.cake index 7a89615..1b7db93 100644 --- a/build.cake +++ b/build.cake @@ -15,7 +15,7 @@ var configuration = Argument("configuration", "Release"); var toolpath = Argument("toolpath", @"tools"); var branch = Argument("branch", EnvironmentVariable("APPVEYOR_REPO_BRANCH")); var nugetApiKey = EnvironmentVariable("nugetApiKey"); -var isRelease = EnvironmentVariable("APPVEYOR_REPO_TAG"); +var isRelease = EnvironmentVariable("APPVEYOR_REPO_TAG") == "true"; var testProjects = new List> { @@ -110,7 +110,7 @@ Task("Pack") Task("NugetPublish") .IsDependentOn("Pack") - .WithCriteria(() => branch == "master") + .WithCriteria(() => branch == "master" && isRelease) .Does(()=> { foreach(var nupkgFile in GetFiles(nupkgRegex)) diff --git a/common.props b/common.props index bb7f4f5..3c19351 100644 --- a/common.props +++ b/common.props @@ -1,6 +1,6 @@ - 2.0.1 + 2.0.2 $(NoWarn);CS1591 https://raw.githubusercontent.com/osoykan/Stove/master/stove.png https://github.com/osoykan/Stove diff --git a/src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQBootstrapper.cs b/src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQBootstrapper.cs index 8a841fa..361f651 100644 --- a/src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQBootstrapper.cs +++ b/src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQBootstrapper.cs @@ -16,7 +16,7 @@ public override void PreStart() StoveConfiguration.GetConfigurerIfExists().Invoke(StoveConfiguration.Modules.StoveRabbitMQ()); } - public override void PostStart() + public override void Start() { StoveConfiguration.Resolver.Resolve().Start(); } diff --git a/src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQMessageBus.cs b/src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQMessageBus.cs index 4a602db..c1ca3ad 100644 --- a/src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQMessageBus.cs +++ b/src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQMessageBus.cs @@ -1,6 +1,5 @@ using System; - -using JetBrains.Annotations; +using System.Threading.Tasks; using MassTransit; @@ -10,12 +9,14 @@ namespace Stove.RabbitMQ { public class StoveRabbitMQMessageBus : IMessageBus { - [NotNull] private readonly IBus _bus; + private readonly IStoveRabbitMQConfiguration _stoveRabbitMqConfiguration; - public StoveRabbitMQMessageBus([NotNull] IBus bus) + public StoveRabbitMQMessageBus(IBus bus, + IStoveRabbitMQConfiguration stoveRabbitMqConfiguration) { _bus = bus; + _stoveRabbitMqConfiguration = stoveRabbitMqConfiguration; } public void Publish(TMessage message) where TMessage : class @@ -37,5 +38,12 @@ public void Publish(object message, Type messageType) { _bus.Publish(message, messageType); } + + public Task CallRequest(TRequest request, TimeSpan timeOut, string queueName) + where TRequest : class + where TResponse : class + { + return _bus.CreateRequestClient(new Uri($"{_stoveRabbitMqConfiguration.HostAddress}{queueName}"), timeOut).Request(request); + } } } diff --git a/src/Stove.RabbitMQ/Stove.RabbitMQ.csproj b/src/Stove.RabbitMQ/Stove.RabbitMQ.csproj index 4d7631d..ad49e2b 100644 --- a/src/Stove.RabbitMQ/Stove.RabbitMQ.csproj +++ b/src/Stove.RabbitMQ/Stove.RabbitMQ.csproj @@ -27,9 +27,9 @@ - - - + + + diff --git a/src/Stove/MQ/IMessageBus.cs b/src/Stove/MQ/IMessageBus.cs index 14e3b41..16b8e91 100644 --- a/src/Stove/MQ/IMessageBus.cs +++ b/src/Stove/MQ/IMessageBus.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using JetBrains.Annotations; @@ -13,5 +14,7 @@ public interface IMessageBus void Publish([NotNull] object message); void Publish([NotNull] object message, [NotNull] Type messageType); + + Task CallRequest(TRequest request, TimeSpan timeOut, string queueName) where TRequest : class where TResponse : class; } } diff --git a/src/Stove/MQ/NullMessageBus.cs b/src/Stove/MQ/NullMessageBus.cs index e3d5894..2d59865 100644 --- a/src/Stove/MQ/NullMessageBus.cs +++ b/src/Stove/MQ/NullMessageBus.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; namespace Stove.MQ { @@ -21,5 +22,10 @@ public void Publish(object message) public void Publish(object message, Type messageType) { } + + public Task CallRequest(TRequest request, TimeSpan timeOut, string queueName) where TRequest : class where TResponse : class + { + return Task.FromResult(default(TResponse)); + } } } diff --git a/test/Stove.Dapper.Tests/Stove.Dapper.Tests.csproj b/test/Stove.Dapper.Tests/Stove.Dapper.Tests.csproj index 98caeb1..bbcc533 100644 --- a/test/Stove.Dapper.Tests/Stove.Dapper.Tests.csproj +++ b/test/Stove.Dapper.Tests/Stove.Dapper.Tests.csproj @@ -36,7 +36,7 @@ - + diff --git a/test/Stove.Demo.WebApi.Core/Stove.Demo.WebApi.Core.csproj b/test/Stove.Demo.WebApi.Core/Stove.Demo.WebApi.Core.csproj index 16fc6fc..c3b99fa 100644 --- a/test/Stove.Demo.WebApi.Core/Stove.Demo.WebApi.Core.csproj +++ b/test/Stove.Demo.WebApi.Core/Stove.Demo.WebApi.Core.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/Stove.EntityFramework.Tests/Stove.EntityFramework.Tests.csproj b/test/Stove.EntityFramework.Tests/Stove.EntityFramework.Tests.csproj index fad505e..96db6e8 100644 --- a/test/Stove.EntityFramework.Tests/Stove.EntityFramework.Tests.csproj +++ b/test/Stove.EntityFramework.Tests/Stove.EntityFramework.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/Stove.EntityFrameworkCore.Dapper.Tests/Stove.EntityFrameworkCore.Dapper.Tests.csproj b/test/Stove.EntityFrameworkCore.Dapper.Tests/Stove.EntityFrameworkCore.Dapper.Tests.csproj index 45441eb..3818008 100644 --- a/test/Stove.EntityFrameworkCore.Dapper.Tests/Stove.EntityFrameworkCore.Dapper.Tests.csproj +++ b/test/Stove.EntityFrameworkCore.Dapper.Tests/Stove.EntityFrameworkCore.Dapper.Tests.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/test/Stove.EntityFrameworkCore.Tests/Stove.EntityFrameworkCore.Tests.csproj b/test/Stove.EntityFrameworkCore.Tests/Stove.EntityFrameworkCore.Tests.csproj index 9d6f2cf..404cb85 100644 --- a/test/Stove.EntityFrameworkCore.Tests/Stove.EntityFrameworkCore.Tests.csproj +++ b/test/Stove.EntityFrameworkCore.Tests/Stove.EntityFrameworkCore.Tests.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/test/Stove.Hangfire.Tests/Stove.Hangfire.Tests.csproj b/test/Stove.Hangfire.Tests/Stove.Hangfire.Tests.csproj index 876ba44..555c96d 100644 --- a/test/Stove.Hangfire.Tests/Stove.Hangfire.Tests.csproj +++ b/test/Stove.Hangfire.Tests/Stove.Hangfire.Tests.csproj @@ -23,8 +23,8 @@ - - + + diff --git a/test/Stove.Mapster.Tests/Stove.Mapster.Tests.csproj b/test/Stove.Mapster.Tests/Stove.Mapster.Tests.csproj index 26e4e01..be330bb 100644 --- a/test/Stove.Mapster.Tests/Stove.Mapster.Tests.csproj +++ b/test/Stove.Mapster.Tests/Stove.Mapster.Tests.csproj @@ -19,8 +19,8 @@ - - + + diff --git a/test/Stove.NHibernate.Tests/Stove.NHibernate.Tests.csproj b/test/Stove.NHibernate.Tests/Stove.NHibernate.Tests.csproj index 62010c5..80dc62f 100644 --- a/test/Stove.NHibernate.Tests/Stove.NHibernate.Tests.csproj +++ b/test/Stove.NHibernate.Tests/Stove.NHibernate.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/test/Stove.NLog.Tests/Stove.NLog.Tests.csproj b/test/Stove.NLog.Tests/Stove.NLog.Tests.csproj index e5f9065..9b1e43b 100644 --- a/test/Stove.NLog.Tests/Stove.NLog.Tests.csproj +++ b/test/Stove.NLog.Tests/Stove.NLog.Tests.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/test/Stove.RabbitMQ.Tests/RabbitMQMessageBus_Tests.cs b/test/Stove.RabbitMQ.Tests/RabbitMQMessageBus_Tests.cs index 0671622..90c028b 100644 --- a/test/Stove.RabbitMQ.Tests/RabbitMQMessageBus_Tests.cs +++ b/test/Stove.RabbitMQ.Tests/RabbitMQMessageBus_Tests.cs @@ -13,10 +13,12 @@ namespace Stove.RabbitMQ.Tests public class RabbitMQMessageBus_Tests : TestBaseWithLocalIocResolver { private readonly IBus _bus; + private readonly IStoveRabbitMQConfiguration _configuration; public RabbitMQMessageBus_Tests() { _bus = Substitute.For(); + _configuration = Substitute.For(); Building(builder => { @@ -24,6 +26,7 @@ public RabbitMQMessageBus_Tests() { r.Register(); r.Register(ctx => _bus); + r.Register(ctx=>_configuration); }); }) .Ok(); diff --git a/test/Stove.RabbitMQ.Tests/Stove.RabbitMQ.Tests.csproj b/test/Stove.RabbitMQ.Tests/Stove.RabbitMQ.Tests.csproj index 317a762..96f24ea 100644 --- a/test/Stove.RabbitMQ.Tests/Stove.RabbitMQ.Tests.csproj +++ b/test/Stove.RabbitMQ.Tests/Stove.RabbitMQ.Tests.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/test/Stove.RavenDB.Tests/Stove.RavenDB.Tests.csproj b/test/Stove.RavenDB.Tests/Stove.RavenDB.Tests.csproj index 8d6ed7d..97a4e8f 100644 --- a/test/Stove.RavenDB.Tests/Stove.RavenDB.Tests.csproj +++ b/test/Stove.RavenDB.Tests/Stove.RavenDB.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/test/Stove.Redis.Tests/Stove.Redis.Tests.csproj b/test/Stove.Redis.Tests/Stove.Redis.Tests.csproj index bdbb874..bc66a16 100644 --- a/test/Stove.Redis.Tests/Stove.Redis.Tests.csproj +++ b/test/Stove.Redis.Tests/Stove.Redis.Tests.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/test/Stove.Serilog.Tests/Stove.Serilog.Tests.csproj b/test/Stove.Serilog.Tests/Stove.Serilog.Tests.csproj index 3e4ed38..26639f3 100644 --- a/test/Stove.Serilog.Tests/Stove.Serilog.Tests.csproj +++ b/test/Stove.Serilog.Tests/Stove.Serilog.Tests.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/test/Stove.Tests.SampleApplication/Stove.Tests.SampleApplication.csproj b/test/Stove.Tests.SampleApplication/Stove.Tests.SampleApplication.csproj index 39e9a0c..68239c6 100644 --- a/test/Stove.Tests.SampleApplication/Stove.Tests.SampleApplication.csproj +++ b/test/Stove.Tests.SampleApplication/Stove.Tests.SampleApplication.csproj @@ -15,7 +15,7 @@ - + diff --git a/test/Stove.Tests/Stove.Tests.csproj b/test/Stove.Tests/Stove.Tests.csproj index 891238c..512baac 100644 --- a/test/Stove.Tests/Stove.Tests.csproj +++ b/test/Stove.Tests/Stove.Tests.csproj @@ -12,8 +12,8 @@ - - + +