From bb814957819f6b8bde62508193c7f36dc221b67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Tue, 29 May 2018 23:46:04 +0200 Subject: [PATCH 01/12] [WIP] Switch to Microsoft.Azure.ServiceBus The [`Microsoft.Azure.ServiceBus`](https://www.nuget.org/packages/Microsoft.Azure.ServiceBus/) package conforms to .NET Standard and thus works fine on Linux and macOS (using Mono). The WindowsAzure.ServiceBus package can't run on Mono since it depends on kernel32.dll. Required incidental changes: * Upgrade target framework from v4.6 to v4.7.1 * Swith to async code * Upgrade `Newtonsoft.Json` from version 9 to version 10 * Delete IsBodyConsumed and State for which I have found no equivalent * Take a dependency on `Mossharbor.AzureWorkArounds.ServiceBus` since management is not (yet) supported with a service bus connection string, see https://github.com/Azure/azure-service-bus-dotnet/issues/65 * Use a local version of `Mossharbor.AzureWorkArounds.ServiceBus` since `GetQueues()` and `GetTopics()` are not implemented in the published package https://github.com/Mossharbor/AzureWorkArounds.ServiceBus/pull/6 --- .../SbManager.IntegrationTests.csproj | 6 +- src/SbManager.IntegrationTests/app.config | 25 -- .../packages.config | 1 - src/SbManager.Tests/App.config | 30 -- .../BrokeredMessageExtensionsTests.cs | 17 +- ...efreshCachedOverviewCommandHandlerTests.cs | 5 +- .../DeadletterVIewBuilderTests.cs | 5 +- .../OverviewModelBuilderTests.cs | 5 +- .../QueueModelBuilderTests.cs | 5 +- .../SubscriptionModelBuilderTests.cs | 5 +- .../TopicModelBuilderTests.cs | 5 +- src/SbManager.Tests/SbManager.Tests.csproj | 7 +- src/SbManager.Tests/packages.config | 1 - src/SbManager/App.config | 29 +- src/SbManager/BusHelpers/BusMonitor.cs | 64 ++-- src/SbManager/BusHelpers/MessagingFactory.cs | 30 ++ src/SbManager/BusHelpers/RequeueAndRemove.cs | 299 ++++++------------ src/SbManager/BusHelpers/Sender.cs | 28 +- src/SbManager/CQRS/Commands/CommandSender.cs | 7 +- src/SbManager/CQRS/Commands/ICommandSender.cs | 14 +- .../CQRS/ModelBuilders/IModelCreator.cs | 16 +- .../CQRS/ModelBuilders/ModelCreator.cs | 5 +- .../tmpl/directives/messagedetails.html | 2 - .../Extensions/BrokeredMessageExtensions.cs | 23 +- .../HttpModules/V1/BusManagerModule.cs | 132 ++++---- .../DeadLetterAllMessagesCommandHandler.cs | 9 +- .../DeadLetterMessageCommandHandler.cs | 9 +- .../DeleteAllBusEntititesCommandHandler.cs | 11 +- .../DeleteAllDeadLettersCommandHandler.cs | 10 +- .../DeleteQueueCommandHandler.cs | 6 +- .../DeleteSubscriptionCommandHandler.cs | 6 +- .../DeleteTopicCommandHandler.cs | 6 +- .../PublishMessageCommandHandler.cs | 7 +- .../RefreshCachedOverviewCommandHandler.cs | 7 +- .../RemoveMessageCommandHandler.cs | 9 +- .../RequeueMessageCommandHandler'.cs | 9 +- .../SendMessageCommandHandler.cs | 7 +- .../DeadletterViewBuilder.cs | 5 +- .../ViewModelBuilders/OverviewModelBuilder.cs | 7 +- .../ViewModelBuilders/QueueMessagesBuilder.cs | 25 +- .../ViewModelBuilders/QueueModelBuilder.cs | 5 +- .../SubscriptionMessagesBuilder.cs | 26 +- .../SubscriptionModelBuilder.cs | 5 +- .../ViewModelBuilders/TopicModelBuilder.cs | 5 +- .../Models/ViewModels/MessageView.cs | 2 - src/SbManager/SbManager.csproj | 94 +++++- src/SbManager/Startup/AutofacRegistrations.cs | 3 +- src/SbManager/packages.config | 21 +- 48 files changed, 505 insertions(+), 555 deletions(-) create mode 100644 src/SbManager/BusHelpers/MessagingFactory.cs diff --git a/src/SbManager.IntegrationTests/SbManager.IntegrationTests.csproj b/src/SbManager.IntegrationTests/SbManager.IntegrationTests.csproj index 442b5bb..aa94178 100644 --- a/src/SbManager.IntegrationTests/SbManager.IntegrationTests.csproj +++ b/src/SbManager.IntegrationTests/SbManager.IntegrationTests.csproj @@ -9,7 +9,7 @@ Properties SbManager.IntegrationTests SbManager.IntegrationTests - v4.6 + v4.7.1 512 ..\ true @@ -37,10 +37,6 @@ False ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll - - False - ..\packages\WindowsAzure.ServiceBus.2.1.4.0\lib\net40-full\Microsoft.ServiceBus.dll - ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/SbManager.IntegrationTests/app.config b/src/SbManager.IntegrationTests/app.config index 163b153..980270c 100644 --- a/src/SbManager.IntegrationTests/app.config +++ b/src/SbManager.IntegrationTests/app.config @@ -6,31 +6,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SbManager.IntegrationTests/packages.config b/src/SbManager.IntegrationTests/packages.config index 0bbb8c1..41ae4a2 100644 --- a/src/SbManager.IntegrationTests/packages.config +++ b/src/SbManager.IntegrationTests/packages.config @@ -8,5 +8,4 @@ - \ No newline at end of file diff --git a/src/SbManager.Tests/App.config b/src/SbManager.Tests/App.config index 7ca87ac..787d521 100644 --- a/src/SbManager.Tests/App.config +++ b/src/SbManager.Tests/App.config @@ -40,34 +40,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SbManager.Tests/Extensions/BrokeredMessageExtensionsTests.cs b/src/SbManager.Tests/Extensions/BrokeredMessageExtensionsTests.cs index 9ec6f04..e813ff2 100644 --- a/src/SbManager.Tests/Extensions/BrokeredMessageExtensionsTests.cs +++ b/src/SbManager.Tests/Extensions/BrokeredMessageExtensionsTests.cs @@ -1,4 +1,5 @@ -using Microsoft.ServiceBus.Messaging; +using System.Text; +using Microsoft.Azure.ServiceBus; using NUnit.Framework; using SbManager.Extensions; using Shouldly; @@ -9,7 +10,7 @@ namespace SbManager.Tests.Extensions [TestFixture] public class BrokeredMessageExtensionsTests { - private BrokeredMessage _message; + private Message _message; private string _messageBody; [Test] @@ -42,19 +43,19 @@ public void CanGetNullMessageBody() void GivenABrokeredMessageWithProperties(params string[] properties) { - _message = new BrokeredMessage(new TestMessage()); + _message = new Message(new byte[0]); foreach (var property in properties) { - _message.Properties.Add(property, "test"); + _message.UserProperties.Add(property, "test"); } } void GivenABrokeredMessageWithBody(string testdata) { - _message = new BrokeredMessage(new TestMessage { Test = testdata }); + _message = new Message(Encoding.UTF8.GetBytes(testdata)); } void GivenABrokeredMessageWithNoBody() { - _message = new BrokeredMessage(null); + _message = new Message(null); } void WhenRemovingProperties(params string[] properties) { @@ -66,11 +67,11 @@ void WhenGettingBody() } void ThenItShouldHaveRemovedTheSpecifiedProperties(params string[] removed) { - foreach (var rem in removed) _message.Properties.ContainsKey(rem).ShouldBe(false); + foreach (var rem in removed) _message.UserProperties.ContainsKey(rem).ShouldBe(false); } void ThenItShouldHaveKeptTheOtherProperties(params string[] remaining) { - foreach (var rem in remaining) _message.Properties.ContainsKey(rem).ShouldBe(true); + foreach (var rem in remaining) _message.UserProperties.ContainsKey(rem).ShouldBe(true); } void ThenTheBodyStringShouldBe(string expected) { diff --git a/src/SbManager.Tests/InternalCommandHandlers/RefreshCachedOverviewCommandHandlerTests.cs b/src/SbManager.Tests/InternalCommandHandlers/RefreshCachedOverviewCommandHandlerTests.cs index f1455ba..a69507c 100644 --- a/src/SbManager.Tests/InternalCommandHandlers/RefreshCachedOverviewCommandHandlerTests.cs +++ b/src/SbManager.Tests/InternalCommandHandlers/RefreshCachedOverviewCommandHandlerTests.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading.Tasks; using NSubstitute; using NUnit.Framework; using SbManager.BusHelpers; @@ -44,9 +45,9 @@ void GivenThatTheBusMonitorReturnsAnOverview() _busMonitor.GetOverview().Returns(_expected); } - void WhenExecutingCommand() + async Task WhenExecutingCommand() { - _handler.Execute(_command); + await _handler.Execute(_command); } void ThenTheBusMonitorIsCalledWithForceFlag() diff --git a/src/SbManager.Tests/Models/ViewModelBuilders/DeadletterVIewBuilderTests.cs b/src/SbManager.Tests/Models/ViewModelBuilders/DeadletterVIewBuilderTests.cs index 7c765b4..4a395b3 100644 --- a/src/SbManager.Tests/Models/ViewModelBuilders/DeadletterVIewBuilderTests.cs +++ b/src/SbManager.Tests/Models/ViewModelBuilders/DeadletterVIewBuilderTests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using NSubstitute; using NUnit.Framework; using SbManager.BusHelpers; @@ -72,9 +73,9 @@ void GivenThatTheBusMonitorReturnsAnOverview() _busMonitor.GetOverview(Arg.Any()).Returns(overview); } - void WhenBuildingModel() + async Task WhenBuildingModel() { - _result = _builder.Build(); + _result = await _builder.Build(); } void ThenDeadlettersAreReturned() diff --git a/src/SbManager.Tests/Models/ViewModelBuilders/OverviewModelBuilderTests.cs b/src/SbManager.Tests/Models/ViewModelBuilders/OverviewModelBuilderTests.cs index e4d67db..e3765a7 100644 --- a/src/SbManager.Tests/Models/ViewModelBuilders/OverviewModelBuilderTests.cs +++ b/src/SbManager.Tests/Models/ViewModelBuilders/OverviewModelBuilderTests.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading.Tasks; using NSubstitute; using NUnit.Framework; using SbManager.BusHelpers; @@ -39,9 +40,9 @@ void GivenThatTheBusMonitorReturnsAnOverview() _busMonitor.GetOverview().Returns(_expected); } - void WhenBuildingModel() + async Task WhenBuildingModel() { - _result = _builder.Build(); + _result = await _builder.Build(); } void ThenTheOverviewIsReturned() diff --git a/src/SbManager.Tests/Models/ViewModelBuilders/QueueModelBuilderTests.cs b/src/SbManager.Tests/Models/ViewModelBuilders/QueueModelBuilderTests.cs index 5eb3e5b..86ee2cf 100644 --- a/src/SbManager.Tests/Models/ViewModelBuilders/QueueModelBuilderTests.cs +++ b/src/SbManager.Tests/Models/ViewModelBuilders/QueueModelBuilderTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using NSubstitute; using NUnit.Framework; using SbManager.BusHelpers; @@ -89,11 +90,11 @@ void GivenThatTheBusMonitorReturnsAnOverviewWithDuplicateQueues() _busMonitor.GetOverview().Returns(overview); } - void WhenBuildingModel(string queuename, bool forceFresh) + async Task WhenBuildingModel(string queuename, bool forceFresh) { try { - _result = _builder.Build(new QueueCriteria(queuename, forceFresh)); + _result = await _builder.Build(new QueueCriteria(queuename, forceFresh)); } catch (Exception ex) { diff --git a/src/SbManager.Tests/Models/ViewModelBuilders/SubscriptionModelBuilderTests.cs b/src/SbManager.Tests/Models/ViewModelBuilders/SubscriptionModelBuilderTests.cs index 945e0fd..782f4b6 100644 --- a/src/SbManager.Tests/Models/ViewModelBuilders/SubscriptionModelBuilderTests.cs +++ b/src/SbManager.Tests/Models/ViewModelBuilders/SubscriptionModelBuilderTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using NSubstitute; using NUnit.Framework; using SbManager.BusHelpers; @@ -95,11 +96,11 @@ void GivenThatTheBusMonitorReturnsAnOverviewWithDuplicateSubscriptions() _busMonitor.GetOverview().Returns(overview); } - void WhenBuildingModel(string topicname, string subscriptionname, bool forceFresh) + async Task WhenBuildingModel(string topicname, string subscriptionname, bool forceFresh) { try { - _result = _builder.Build(new SubscriptionCriteria(topicname, subscriptionname, forceFresh)); + _result = await _builder.Build(new SubscriptionCriteria(topicname, subscriptionname, forceFresh)); } catch (Exception ex) { diff --git a/src/SbManager.Tests/Models/ViewModelBuilders/TopicModelBuilderTests.cs b/src/SbManager.Tests/Models/ViewModelBuilders/TopicModelBuilderTests.cs index 08818c6..aa87c75 100644 --- a/src/SbManager.Tests/Models/ViewModelBuilders/TopicModelBuilderTests.cs +++ b/src/SbManager.Tests/Models/ViewModelBuilders/TopicModelBuilderTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using NSubstitute; using NUnit.Framework; using SbManager.BusHelpers; @@ -95,11 +96,11 @@ void GivenThatTheBusMonitorReturnsAnOverviewWithDuplicateTopics() _busMonitor.GetOverview().Returns(overview); } - void WhenBuildingModel(string topicname, bool forceFresh) + async Task WhenBuildingModel(string topicname, bool forceFresh) { try { - _result = _builder.Build(new TopicCriteria(topicname, forceFresh)); + _result = await _builder.Build(new TopicCriteria(topicname, forceFresh)); } catch (Exception ex) { diff --git a/src/SbManager.Tests/SbManager.Tests.csproj b/src/SbManager.Tests/SbManager.Tests.csproj index 65da55e..5056b28 100644 --- a/src/SbManager.Tests/SbManager.Tests.csproj +++ b/src/SbManager.Tests/SbManager.Tests.csproj @@ -9,7 +9,7 @@ Properties SbManager.Tests SbManager.Tests - v4.6 + v4.7.1 512 ..\ true @@ -41,9 +41,8 @@ ..\packages\CsQuery.1.3.4\lib\net40\CsQuery.dll - - False - ..\packages\WindowsAzure.ServiceBus.2.1.4.0\lib\net40-full\Microsoft.ServiceBus.dll + + ..\packages\Microsoft.Azure.ServiceBus.3.0.1.16\lib\netstandard2.0\Microsoft.Azure.ServiceBus.dll ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/SbManager.Tests/packages.config b/src/SbManager.Tests/packages.config index 17ece9c..6331a5d 100644 --- a/src/SbManager.Tests/packages.config +++ b/src/SbManager.Tests/packages.config @@ -12,5 +12,4 @@ - \ No newline at end of file diff --git a/src/SbManager/App.config b/src/SbManager/App.config index 60d54f5..ff19214 100644 --- a/src/SbManager/App.config +++ b/src/SbManager/App.config @@ -23,7 +23,7 @@ - + @@ -67,29 +67,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/SbManager/BusHelpers/BusMonitor.cs b/src/SbManager/BusHelpers/BusMonitor.cs index db5455f..dd61b79 100644 --- a/src/SbManager/BusHelpers/BusMonitor.cs +++ b/src/SbManager/BusHelpers/BusMonitor.cs @@ -1,54 +1,60 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.ServiceBus.Messaging; +using System.Threading; +using System.Threading.Tasks; +using Mossharbor.AzureWorkArounds.ServiceBus; using SbManager.Models.ViewModels; namespace SbManager.BusHelpers { public interface IBusMonitor { - Overview GetOverview(bool fresh = false); + Task GetOverview(bool fresh = false); } public class BusMonitor : IBusMonitor { - private readonly IConfig _config; + private readonly NamespaceManager _namespaceManager; private const long RefreshTime = 5000; private DateTime _lastTouch = new DateTime(1, 1, 1); private Overview _cached; - private readonly object _lock = new { }; + private readonly SemaphoreSlim _semaphore = new SemaphoreSlim(1); public Func GetTime = () => DateTime.Now; - public BusMonitor(IConfig config) + public BusMonitor(NamespaceManager namespaceManager) { - _config = config; + _namespaceManager = namespaceManager; } - public Overview GetOverview(bool forceDirty = false) + public async Task GetOverview(bool forceDirty = false) { if (!Dirty(forceDirty)) return _cached; - lock (_lock) + await _semaphore.WaitAsync(); + try { - if (Dirty(forceDirty)) _cached = Fetch(); + if (Dirty(forceDirty)) _cached = await Fetch(); + } + finally + { + _semaphore.Release(); } return _cached; } - private Overview Fetch() + private Task Fetch() { - var manager = Microsoft.ServiceBus.NamespaceManager.CreateFromConnectionString(_config.BusConnectionString); var overview = new Overview { - Queues = manager.GetQueues().Select(e => new Queue + Queues = _namespaceManager.GetQueues().Select(e => new Queue { Status = e.Status.ToString(), - ActiveMessageCount = e.MessageCountDetails.ActiveMessageCount, - DeadLetterCount = e.MessageCountDetails.DeadLetterMessageCount, - ScheduledMessageCount = e.MessageCountDetails.ScheduledMessageCount, - TransferMessageCount = e.MessageCountDetails.TransferMessageCount, - DeadTransferMessageCount = e.MessageCountDetails.TransferDeadLetterMessageCount, + ActiveMessageCount = e.CountDetails.ActiveMessageCount, + DeadLetterCount = e.CountDetails.DeadLetterMessageCount, + ScheduledMessageCount = e.CountDetails.ScheduledMessageCount, + TransferMessageCount = e.CountDetails.TransferMessageCount, + DeadTransferMessageCount = e.CountDetails.TransferDeadLetterMessageCount, SizeInBytes = e.SizeInBytes, AutoDeleteOnIdle = new Time(e.AutoDeleteOnIdle), DefaultMessageTTL = new Time(e.DefaultMessageTimeToLive), @@ -59,7 +65,7 @@ private Overview Fetch() AccessedAt = e.AccessedAt, Name = e.Path }).ToList(), - Topics = manager.GetTopics().Select(e => new Topic + Topics = _namespaceManager.GetTopics().Select(e => new Topic { Status = e.Status.ToString(), Name = e.Path, @@ -69,31 +75,35 @@ private Overview Fetch() DuplicateDetectionWindow = new Time(e.DuplicateDetectionHistoryTimeWindow), CreatedAt = e.CreatedAt, UpdatedAt = e.UpdatedAt, - AccessedAt = e.AccessedAt, + //AccessedAt = e.AccessedAt, }).ToList(), }; foreach (var topic in overview.Topics) { - topic.Subscriptions = manager.GetSubscriptions(topic.Name).Select(e => new Subscription + topic.Subscriptions = _namespaceManager.GetSubscriptions(topic.Name).Select(e => new Subscription { Status = e.Status.ToString(), Name = e.Name, TopicName = topic.Name, - ActiveMessageCount = e.MessageCountDetails.ActiveMessageCount, - DeadLetterCount = e.MessageCountDetails.DeadLetterMessageCount, - ScheduledMessageCount = e.MessageCountDetails.ScheduledMessageCount, - TransferMessageCount = e.MessageCountDetails.TransferMessageCount, - DeadTransferMessageCount = e.MessageCountDetails.TransferDeadLetterMessageCount, + //ActiveMessageCount = e.CountDetails.ActiveMessageCount, + //DeadLetterCount = e.CountDetails.DeadLetterMessageCount, + //ScheduledMessageCount = e.CountDetails.ScheduledMessageCount, + //TransferMessageCount = e.CountDetails.TransferMessageCount, + //DeadTransferMessageCount = e.CountDetails.TransferDeadLetterMessageCount, AutoDeleteOnIdle = new Time(e.AutoDeleteOnIdle), DefaultMessageTTL = new Time(e.DefaultMessageTimeToLive), LockDuration = new Time(e.LockDuration), CreatedAt = e.CreatedAt, UpdatedAt = e.UpdatedAt, AccessedAt = e.AccessedAt, - Rules = manager.GetRules(topic.Name, e.Name).Select(MapRule).ToList() }).ToList(); + foreach (var subscription in topic.Subscriptions) + { + subscription.Rules = _namespaceManager.GetRules(topic.Name, subscription.Name).Select(MapRule).ToList(); + } + topic.ActiveMessageCount = topic.Subscriptions.Sum(s => s.ActiveMessageCount); topic.DeadLetterCount = topic.Subscriptions.Sum(s => s.DeadLetterCount); topic.ScheduledMessageCount = topic.Subscriptions.Sum(s => s.ScheduledMessageCount); @@ -108,7 +118,7 @@ private Overview Fetch() overview.TotalActiveMessages = queueMessageCounts.ActiveMessageCount + topicMessageCounts.ActiveMessageCount; overview.TotalScheduledMessages = queueMessageCounts.ScheduledMessageCount + topicMessageCounts.ScheduledMessageCount; - return overview; + return Task.FromResult(overview); } private class MessageCounts diff --git a/src/SbManager/BusHelpers/MessagingFactory.cs b/src/SbManager/BusHelpers/MessagingFactory.cs new file mode 100644 index 0000000..f21379c --- /dev/null +++ b/src/SbManager/BusHelpers/MessagingFactory.cs @@ -0,0 +1,30 @@ +using Microsoft.Azure.ServiceBus; +using Microsoft.Azure.ServiceBus.Core; + +namespace SbManager.BusHelpers +{ + public class MessagingFactory + { + public static MessagingFactory CreateFromConnectionString(string connectionString) + { + return new MessagingFactory(connectionString); + } + + private readonly ServiceBusConnection _connection; + + private MessagingFactory(string connectionString) + { + _connection = new ServiceBusConnection(connectionString); + } + + public MessageReceiver CreateMessageReceiver(string path) + { + return new MessageReceiver(_connection, path); + } + + public MessageSender CreateMessageSender(string path) + { + return new MessageSender(_connection, path); + } + } +} \ No newline at end of file diff --git a/src/SbManager/BusHelpers/RequeueAndRemove.cs b/src/SbManager/BusHelpers/RequeueAndRemove.cs index 3cff1c6..2a54aa6 100644 --- a/src/SbManager/BusHelpers/RequeueAndRemove.cs +++ b/src/SbManager/BusHelpers/RequeueAndRemove.cs @@ -1,277 +1,174 @@ using System; -using System.IO; using System.Text; -using Microsoft.ServiceBus; -using Microsoft.ServiceBus.Messaging; +using System.Threading.Tasks; +using Microsoft.Azure.ServiceBus; +using Microsoft.Azure.ServiceBus.Core; using SbManager.Extensions; +using BrokeredMessage = Microsoft.Azure.ServiceBus.Message; +using static Microsoft.Azure.ServiceBus.EntityNameHelper; namespace SbManager.BusHelpers { public interface IRequeueAndRemove { - void RequeueAll(string queuePath); - void RequeueAll(string topicPath, string subscriptionName); - void RequeueOne(string queuePath, string messageId, string newBody); - void RequeueOne(string topicPath, string subscriptionName, string messageId, string newBody); - - void RemoveAll(string queuePath); - void RemoveAll(string topicPath, string subscriptionName); - void RemoveOne(string queuePath, string messageId); - void RemoveOne(string topicPath, string subscriptionName, string messageId); - - void Kill(string queuePath, string messageId); - void Kill(string topicPath, string subscriptionName, string messageId); - void KillAll(string queuePath); - void KillAll(string topicPath, string subscriptionName); + Task RequeueAll(string path); + Task RequeueAll(string topicPath, string subscriptionName); + Task RequeueOne(string path, string messageId, string newBody); + Task RequeueOne(string topicPath, string subscriptionName, string messageId, string newBody); + + Task RemoveAll(string path); + Task RemoveAll(string topicPath, string subscriptionName); + Task RemoveOne(string path, string messageId); + Task RemoveOne(string topicPath, string subscriptionName, string messageId); + + Task KillAll(string path); + Task KillAll(string topicPath, string subscriptionName); + Task KillOne(string path, string messageId); + Task KillOne(string topicPath, string subscriptionName, string messageId); } public class RequeueAndRemove : IRequeueAndRemove { private readonly MessagingFactory _messagingFactory; - private readonly NamespaceManager _namespaceManager; - public RequeueAndRemove(MessagingFactory messagingFactory, NamespaceManager namespaceManager) + public RequeueAndRemove(MessagingFactory messagingFactory) { _messagingFactory = messagingFactory; - _namespaceManager = namespaceManager; } - public void RequeueAll(string queuePath) + public async Task RequeueAll(string path) { - var client = _messagingFactory.CreateQueueClient(queuePath.MakeDeadLetterPath()); - var queue = _namespaceManager.GetQueue(queuePath); - var count = queue.MessageCountDetails.DeadLetterMessageCount; - var sender = client.MessagingFactory.CreateMessageSender(queuePath); + var receiver = _messagingFactory.CreateMessageReceiver(FormatDeadLetterPath(path)); + var sender = _messagingFactory.CreateMessageSender(path); - for (var i = 0; i < count; i++) + // TODO: parallelize this loop? + Message msg; + while ((msg = await receiver.ReceiveAsync(TimeSpan.FromSeconds(5))) != null) { - var msg = client.Receive(new TimeSpan(0, 0, 5)); - if (msg == null) break; var clone = Clone(msg); clone.RemoveProperties(GetPropertiesToRemove()); - if (clone.Properties.ContainsKey("RequeuedFrom")) clone.Properties["RequeuedFrom"] = clone.Properties["RequeuedFrom"] += "," + msg.MessageId; - else clone.Properties.Add("RequeuedFrom", msg.MessageId); + if (clone.UserProperties.ContainsKey("RequeuedFrom")) clone.UserProperties["RequeuedFrom"] = clone.UserProperties["RequeuedFrom"] += "," + msg.MessageId; + else clone.UserProperties.Add("RequeuedFrom", msg.MessageId); - sender.Send(clone); - msg.Complete(); + await sender.SendAsync(clone); + await receiver.CompleteAsync(msg.SystemProperties.LockToken); } } - public void RequeueAll(string topicPath, string subscriptionName) + public Task RequeueAll(string topicPath, string subscriptionName) { - var client = _messagingFactory.CreateSubscriptionClient(topicPath, subscriptionName.MakeDeadLetterPath()); - var sub = _namespaceManager.GetSubscription(topicPath, subscriptionName); - var count = sub.MessageCountDetails.DeadLetterMessageCount; - var sender = client.MessagingFactory.CreateMessageSender(client.TopicPath); - - for (var i = 0; i < count; i++) - { - var msg = client.Receive(new TimeSpan(0, 0, 5)); - if (msg == null) break; - var clone = Clone(msg); - clone.RemoveProperties(GetPropertiesToRemove()); - - if (clone.Properties.ContainsKey("RequeuedFrom")) clone.Properties["RequeuedFrom"] = clone.Properties["RequeuedFrom"] += "," + msg.MessageId; - else clone.Properties.Add("RequeuedFrom", msg.MessageId); - - sender.Send(clone); - msg.Complete(); - } + return RequeueAll(FormatSubscriptionPath(topicPath, subscriptionName)); } - public void RequeueOne(string queuePath, string messageId, string newBody) + public async Task RequeueOne(string path, string messageId, string newBody) { - var client = _messagingFactory.CreateQueueClient(queuePath); - var queue = _namespaceManager.GetQueue(queuePath.RemoveDeadLetterPath()); - var count = GetQueueMessageCount(queuePath, queue); - var sender = _messagingFactory.CreateMessageSender(queuePath.RemoveDeadLetterPath()); + var receiver = _messagingFactory.CreateMessageReceiver(path); + var sender = _messagingFactory.CreateMessageSender(path); - var msgs = client.ReceiveBatch(Convert.ToInt32(count)); - foreach (var msg in msgs) + // TODO: parallelize this loop + Message msg; + while ((msg = await receiver.ReceiveAsync(TimeSpan.FromSeconds(5))) != null) { if (msg.MessageId != messageId) { - msg.Abandon(); + await receiver.AbandonAsync(msg.SystemProperties.LockToken); continue; } var clone = Clone(msg, newBody); clone.RemoveProperties(GetPropertiesToRemove()); - if (clone.Properties.ContainsKey("RequeuedFrom")) clone.Properties["RequeuedFrom"] = clone.Properties["RequeuedFrom"] += "," + msg.MessageId; - else clone.Properties.Add("RequeuedFrom", msg.MessageId); + if (clone.UserProperties.ContainsKey("RequeuedFrom")) clone.UserProperties["RequeuedFrom"] = clone.UserProperties["RequeuedFrom"] += "," + msg.MessageId; + else clone.UserProperties.Add("RequeuedFrom", msg.MessageId); - msg.Complete(); - sender.Send(clone); + await receiver.CompleteAsync(msg.SystemProperties.LockToken); + await sender.SendAsync(clone); } } - public void RequeueOne(string topicPath, string subscriptionName, string messageId, string newBody) + public Task RequeueOne(string topicPath, string subscriptionName, string messageId, string newBody) { - var client = _messagingFactory.CreateSubscriptionClient(topicPath, subscriptionName); - var sub = _namespaceManager.GetSubscription(topicPath, subscriptionName.RemoveDeadLetterPath()); - var count = GetSubscriptionMessageCount(subscriptionName, sub); - var sender = client.MessagingFactory.CreateMessageSender(client.TopicPath); - - var msgs = client.ReceiveBatch(Convert.ToInt32(count)); - foreach (var msg in msgs) - { - if (msg.MessageId != messageId) - { - msg.Abandon(); - continue; - } - var clone = Clone(msg, newBody); - clone.RemoveProperties(GetPropertiesToRemove()); - - if (clone.Properties.ContainsKey("RequeuedFrom")) clone.Properties["RequeuedFrom"] = clone.Properties["RequeuedFrom"] += "," + msg.MessageId; - else clone.Properties.Add("RequeuedFrom", msg.MessageId); - - sender.Send(clone); - msg.Complete(); - } + return RequeueOne(FormatSubscriptionPath(topicPath, subscriptionName), messageId, newBody); } - public void RemoveAll(string queuePath) + public Task RemoveAll(string path) { - var client = _messagingFactory.CreateQueueClient(queuePath); - var queue = _namespaceManager.GetQueue(queuePath.RemoveDeadLetterPath()); - var count = GetQueueMessageCount(queuePath, queue); - - for (var i = 0; i < count; i++) - { - var msg = client.Receive(new TimeSpan(0, 0, 5)); - if (msg == null) break; - msg.Complete(); - } + return PerformAll(path, async (receiver, lockToken) => await receiver.CompleteAsync(lockToken)); } - public void RemoveAll(string topicPath, string subscriptionName) + public Task RemoveAll(string topicPath, string subscriptionName) { - var client = _messagingFactory.CreateSubscriptionClient(topicPath, subscriptionName); - var sub = _namespaceManager.GetSubscription(topicPath, subscriptionName.RemoveDeadLetterPath()); - var count = GetSubscriptionMessageCount(subscriptionName, sub); - - for (var i = 0; i < count; i++) - { - var msg = client.Receive(new TimeSpan(0, 0, 5)); - if (msg == null) break; - msg.Complete(); - } + return RemoveAll(FormatSubscriptionPath(topicPath, subscriptionName)); } - public void RemoveOne(string queuePath, string messageId) + public Task RemoveOne(string path, string messageId) { - var client = _messagingFactory.CreateQueueClient(queuePath); - var queue = _namespaceManager.GetQueue(queuePath.RemoveDeadLetterPath()); - var count = GetQueueMessageCount(queuePath, queue); - - var msgs = client.ReceiveBatch(Convert.ToInt32(count)); - foreach (var msg in msgs) - { - if (msg.MessageId != messageId) - { - msg.Abandon(); - continue; - } - msg.Complete(); - } + return PerformOne(path, messageId, async (receiver, lockToken) => await receiver.CompleteAsync(lockToken)); } - public void RemoveOne(string topicPath, string subscriptionName, string messageId) + public Task RemoveOne(string topicPath, string subscriptionName, string messageId) { - var client = _messagingFactory.CreateSubscriptionClient(topicPath, subscriptionName); - var sub = _namespaceManager.GetSubscription(topicPath, subscriptionName.RemoveDeadLetterPath()); - var count = GetSubscriptionMessageCount(subscriptionName, sub); - - var msgs = client.ReceiveBatch(Convert.ToInt32(count)); - foreach (var msg in msgs) - { - if (msg.MessageId != messageId) - { - msg.Abandon(); - continue; - } - msg.Complete(); - } + return RemoveOne(FormatSubscriptionPath(topicPath, subscriptionName), messageId); } - public void Kill(string queuePath, string messageId) + public Task KillAll(string path) { - var client = _messagingFactory.CreateQueueClient(queuePath); - var queue = _namespaceManager.GetQueue(queuePath.RemoveDeadLetterPath()); - var count = GetQueueMessageCount(queuePath, queue); - - var msgs = client.ReceiveBatch(Convert.ToInt32(count)); - foreach (var msg in msgs) - { - if (msg.MessageId != messageId) - { - msg.Abandon(); - continue; - } - msg.DeadLetter(); - return; - } + return PerformAll(path, async (receiver, lockToken) => await receiver.DeadLetterAsync(lockToken)); } - public void Kill(string topicPath, string subscriptionName, string messageId) + public Task KillAll(string topicPath, string subscriptionName) { - var client = _messagingFactory.CreateSubscriptionClient(topicPath, subscriptionName); - var sub = _namespaceManager.GetSubscription(topicPath, subscriptionName.RemoveDeadLetterPath()); - var count = GetSubscriptionMessageCount(subscriptionName, sub); - - var msgs = client.ReceiveBatch(Convert.ToInt32(count)); - foreach (var msg in msgs) - { - if (msg.MessageId != messageId) - { - msg.Abandon(); - continue; - } - msg.DeadLetter(); - return; - } + return KillAll(FormatSubscriptionPath(topicPath, subscriptionName)); } - - public void KillAll(string queuePath) + + public Task KillOne(string path, string messageId) { - var client = _messagingFactory.CreateQueueClient(queuePath); - var queue = _namespaceManager.GetQueue(queuePath.RemoveDeadLetterPath()); - var count = GetQueueMessageCount(queuePath, queue); - + return PerformOne(path, messageId, async (receiver, lockToken) => await receiver.DeadLetterAsync(lockToken)); + } - for (var i = 0; i < count; i++) - { - var msg = client.Receive(new TimeSpan(0, 0, 5)); - if (msg == null) break; - msg.DeadLetter(); - } + public Task KillOne(string topicPath, string subscriptionName, string messageId) + { + return KillOne(FormatSubscriptionPath(topicPath, subscriptionName), messageId); } - public void KillAll(string topicPath, string subscriptionName) + public virtual string[] GetPropertiesToRemove() { - var client = _messagingFactory.CreateSubscriptionClient(topicPath, subscriptionName); - var sub = _namespaceManager.GetSubscription(topicPath, subscriptionName.RemoveDeadLetterPath()); - var count = GetSubscriptionMessageCount(subscriptionName, sub); + return new []{"ExceptionType", "ExceptionMessage", "ExceptionStackTrace", "ExceptionTimestamp", "ExceptionMachineName", "ExceptionIdentityName", "DeadLetterReason", "DeadLetterErrorDescription"}; + } - for (var i = 0; i < count; i++) + private async Task PerformAll(string path, Func action) + { + var receiver = _messagingFactory.CreateMessageReceiver(path); + + // TODO: parallelize this loop? + Message msg; + while ((msg = await receiver.ReceiveAsync(TimeSpan.FromSeconds(5))) != null) { - var msg = client.Receive(new TimeSpan(0, 0, 5)); - if (msg == null) break; - msg.DeadLetter(); + await action(receiver, msg.SystemProperties.LockToken); } } - public virtual string[] GetPropertiesToRemove() + private async Task PerformOne(string path, string messageId, Func action) { - return new []{"ExceptionType", "ExceptionMessage", "ExceptionStackTrace", "ExceptionTimestamp", "ExceptionMachineName", "ExceptionIdentityName", "DeadLetterReason", "DeadLetterErrorDescription"}; + var receiver = _messagingFactory.CreateMessageReceiver(path); + + // TODO: parallelize this loop? + Message msg; + while ((msg = await receiver.ReceiveAsync(TimeSpan.FromSeconds(5))) != null) + { + if (msg.MessageId != messageId) + { + await receiver.AbandonAsync(msg.SystemProperties.LockToken); + continue; + } + await action(receiver, msg.SystemProperties.LockToken); + } } - + private BrokeredMessage Clone(BrokeredMessage msg, string newBody = null) { if (string.IsNullOrWhiteSpace(newBody)) return msg.Clone(); - var cloned = new BrokeredMessage(new MemoryStream(Encoding.UTF8.GetBytes(newBody)), true) + var cloned = new BrokeredMessage(Encoding.UTF8.GetBytes(newBody)) { Label = msg.Label, ContentType = msg.ContentType, @@ -285,21 +182,11 @@ private BrokeredMessage Clone(BrokeredMessage msg, string newBody = null) ScheduledEnqueueTimeUtc = msg.ScheduledEnqueueTimeUtc, }; - foreach (var property in msg.Properties) + foreach (var property in msg.UserProperties) { - cloned.Properties.Add(property.Key, property.Value); + cloned.UserProperties.Add(property.Key, property.Value); } return cloned; } - - private static long GetQueueMessageCount(string queuePath, QueueDescription queue) - { - return queuePath.IsDeadLetterPath() ? queue.MessageCountDetails.DeadLetterMessageCount : (queue.MessageCountDetails.ActiveMessageCount + queue.MessageCountDetails.ScheduledMessageCount); - } - - private static long GetSubscriptionMessageCount(string subscriptionName, SubscriptionDescription sub) - { - return subscriptionName.IsDeadLetterPath() ? sub.MessageCountDetails.DeadLetterMessageCount : (sub.MessageCountDetails.ActiveMessageCount + sub.MessageCountDetails.ScheduledMessageCount); - } } } diff --git a/src/SbManager/BusHelpers/Sender.cs b/src/SbManager/BusHelpers/Sender.cs index 66c64a9..6ab3bc2 100644 --- a/src/SbManager/BusHelpers/Sender.cs +++ b/src/SbManager/BusHelpers/Sender.cs @@ -1,15 +1,15 @@ -using System.IO; -using System.Text; -using Microsoft.ServiceBus.Messaging; +using System.Text; +using System.Threading.Tasks; using SbManager.Extensions; using SbManager.Models.ViewModels; +using BrokeredMessage = Microsoft.Azure.ServiceBus.Message; namespace SbManager.BusHelpers { public interface ISender { - void Send(Message message, string queuePath); - void Publish(Message message, string topicPath); + Task Send(Message message, string queuePath); + Task Publish(Message message, string topicPath); } public class Sender : ISender @@ -21,23 +21,21 @@ public Sender(MessagingFactory messagingFactory) _messagingFactory = messagingFactory; } - public void Send(Message message, string queuePath) + public async Task Send(Message message, string queuePath) { - var client = _messagingFactory.CreateQueueClient(queuePath); - var sender = client.MessagingFactory.CreateMessageSender(client.Path); - sender.Send(Map(message)); + var sender = _messagingFactory.CreateMessageSender(queuePath); + await sender.SendAsync(Map(message)); } - public void Publish(Message message, string topicPath) + public async Task Publish(Message message, string topicPath) { - var client = _messagingFactory.CreateTopicClient(topicPath); - var sender = client.MessagingFactory.CreateMessageSender(client.Path); - sender.Send(Map(message)); + var sender = _messagingFactory.CreateMessageSender(topicPath); + await sender.SendAsync(Map(message)); } private BrokeredMessage Map(Message message) { - var brokered = new BrokeredMessage(new MemoryStream(Encoding.UTF8.GetBytes(message.Body)), true); + var brokered = new BrokeredMessage(Encoding.UTF8.GetBytes(message.Body)); if (message.Label.HasValue()) brokered.Label = message.Label; if (message.ContentType.HasValue()) brokered.ContentType = message.ContentType; if (message.MessageId.HasValue()) brokered.MessageId = message.MessageId; @@ -53,7 +51,7 @@ private BrokeredMessage Map(Message message) { foreach (var property in message.CustomProperties) { - brokered.Properties.Add(property.Key, property.Value); + brokered.UserProperties.Add(property.Key, property.Value); } } diff --git a/src/SbManager/CQRS/Commands/CommandSender.cs b/src/SbManager/CQRS/Commands/CommandSender.cs index 83f9b09..978b060 100644 --- a/src/SbManager/CQRS/Commands/CommandSender.cs +++ b/src/SbManager/CQRS/Commands/CommandSender.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Autofac; namespace SbManager.CQRS.Commands @@ -12,7 +13,7 @@ public CommandSender(ILifetimeScope lifetimeScope) _lifetimeScope = lifetimeScope; } - public void Send(TCommand command) + public async Task Send(TCommand command) where TCommand : class, ICommand { if (command == null) throw new NullReferenceException("command"); @@ -21,10 +22,10 @@ public void Send(TCommand command) if (handler == null) throw new InvalidOperationException("Could not resolve command handler for command type " + command.GetType().FullName); - handler.Execute(command); + await handler.Execute(command); } - public TResult SendWithResult(TCommand command) + public Task SendWithResult(TCommand command) where TCommand : class, ICommand { if (command == null) throw new NullReferenceException("command"); diff --git a/src/SbManager/CQRS/Commands/ICommandSender.cs b/src/SbManager/CQRS/Commands/ICommandSender.cs index 926cad2..113a36e 100644 --- a/src/SbManager/CQRS/Commands/ICommandSender.cs +++ b/src/SbManager/CQRS/Commands/ICommandSender.cs @@ -1,9 +1,11 @@ -namespace SbManager.CQRS.Commands +using System.Threading.Tasks; + +namespace SbManager.CQRS.Commands { public interface ICommandSender { - void Send(TCommand command) where TCommand : class, ICommand; - TResult SendWithResult(TCommand command) where TCommand : class, ICommand; + Task Send(TCommand command) where TCommand : class, ICommand; + Task SendWithResult(TCommand command) where TCommand : class, ICommand; } public interface ICommandHandlerBase { } @@ -12,12 +14,12 @@ public interface ICommand { } public interface ICommandHandler : ICommandHandlerBase where TCommand : class, ICommand { - void Execute(TCommand command); + Task Execute(TCommand command); } - public interface ICommandHandlerWithResult : ICommandHandler, ICommandHandlerBase + public interface ICommandHandlerWithResult : ICommandHandler, ICommandHandlerBase where TCommand : class, ICommand { - TResult ExecuteWithResult(TCommand command); + Task ExecuteWithResult(TCommand command); } } \ No newline at end of file diff --git a/src/SbManager/CQRS/ModelBuilders/IModelCreator.cs b/src/SbManager/CQRS/ModelBuilders/IModelCreator.cs index 482249c..295489d 100644 --- a/src/SbManager/CQRS/ModelBuilders/IModelCreator.cs +++ b/src/SbManager/CQRS/ModelBuilders/IModelCreator.cs @@ -1,26 +1,28 @@ -namespace SbManager.CQRS.ModelBuilders +using System.Threading.Tasks; + +namespace SbManager.CQRS.ModelBuilders { public interface IModelCreator { - TModel Build() + Task Build() where TModel : class; - TModel Build(TCriteria criteria) + Task Build(TCriteria criteria) where TCriteria : class where TModel : class; } public interface IModelBuilderBase { } - public interface IModelBuilder : IModelBuilderBase + public interface IModelBuilder : IModelBuilderBase where TModel : class { - TModel Build(); + Task Build(); } - public interface IModelBuilderWithCriteria : IModelBuilderBase + public interface IModelBuilderWithCriteria : IModelBuilderBase where TCriteria : class where TModel : class { - TModel Build(TCriteria criteria); + Task Build(TCriteria criteria); } } diff --git a/src/SbManager/CQRS/ModelBuilders/ModelCreator.cs b/src/SbManager/CQRS/ModelBuilders/ModelCreator.cs index da95752..2c59c2c 100644 --- a/src/SbManager/CQRS/ModelBuilders/ModelCreator.cs +++ b/src/SbManager/CQRS/ModelBuilders/ModelCreator.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Autofac; namespace SbManager.CQRS.ModelBuilders @@ -12,7 +13,7 @@ public ModelCreator(ILifetimeScope lifetimeScope) _lifetimeScope = lifetimeScope; } - public TModel Build() where TModel : class + public Task Build() where TModel : class { var builder = _lifetimeScope.Resolve>(); @@ -22,7 +23,7 @@ public TModel Build() where TModel : class return model; } - public TModel Build(TCriteria criteria) + public Task Build(TCriteria criteria) where TCriteria : class where TModel : class { diff --git a/src/SbManager/Content/tmpl/directives/messagedetails.html b/src/SbManager/Content/tmpl/directives/messagedetails.html index 0b65f8d..2293251 100644 --- a/src/SbManager/Content/tmpl/directives/messagedetails.html +++ b/src/SbManager/Content/tmpl/directives/messagedetails.html @@ -19,7 +19,6 @@

Message Properties

  • -
  • @@ -30,7 +29,6 @@

    Message Properties

  • -
  • diff --git a/src/SbManager/Extensions/BrokeredMessageExtensions.cs b/src/SbManager/Extensions/BrokeredMessageExtensions.cs index ea7c98e..9eabca8 100644 --- a/src/SbManager/Extensions/BrokeredMessageExtensions.cs +++ b/src/SbManager/Extensions/BrokeredMessageExtensions.cs @@ -1,32 +1,21 @@ -using System; -using System.IO; -using Microsoft.ServiceBus.Messaging; +using System.Text; +using Microsoft.Azure.ServiceBus; namespace SbManager.Extensions { public static class BrokeredMessageExtensions { - public static void RemoveProperties(this BrokeredMessage message, params string[] propertynames) + public static void RemoveProperties(this Message message, params string[] propertynames) { foreach (var propertyname in propertynames) { - if (message.Properties.ContainsKey(propertyname)) message.Properties.Remove(propertyname); + if (message.UserProperties.ContainsKey(propertyname)) message.UserProperties.Remove(propertyname); } } - public static string GetBodyString(this BrokeredMessage message) + public static string GetBodyString(this Message message) { - try - { - var stream = message.GetBody(); - if (stream == null) return null; - return new StreamReader(stream).ReadToEnd(); - } - catch (InvalidOperationException lockException) - { - if (!lockException.Message.Contains("Operation is not valid due to the current state of the object")) throw; - return null; - } + return message.Body != null ? Encoding.UTF8.GetString(message.Body) : null; } } } diff --git a/src/SbManager/HttpModules/V1/BusManagerModule.cs b/src/SbManager/HttpModules/V1/BusManagerModule.cs index d1553a1..4562caf 100644 --- a/src/SbManager/HttpModules/V1/BusManagerModule.cs +++ b/src/SbManager/HttpModules/V1/BusManagerModule.cs @@ -23,107 +23,107 @@ public BusManagerModule(IRequeueAndRemove requeueAndRemove, IModelCreator modelC _modelCreator = modelCreator; _commandSender = commandSender; - Get["/"] = - _ => _modelCreator.Build(); - Post["/deleteall"] = - _ => { - _commandSender.Send(new DeleteAllBusEntititesCommand()); + Get["/", true] = + async (_, ct) => await _modelCreator.Build(); + Post["/deleteall", true] = + async (_, ct) => { + await _commandSender.Send(new DeleteAllBusEntititesCommand()); return new { success = true }; }; - Post["/deletealldeadletters"] = - _ => { - _commandSender.Send(new DeleteAllDeadLettersCommand()); + Post["/deletealldeadletters", true] = + async (_, ct) => { + await _commandSender.Send(new DeleteAllDeadLettersCommand()); return new { success = true }; }; - Get["/deadletters"] = - _ => _modelCreator.Build(); - Get["/topic/{tid}"] = - _ => _modelCreator.Build(new TopicCriteria(To.String((object)_.tid))); - Get["/queue/{qid}"] = - _ => _modelCreator.Build(new QueueCriteria(To.String((object)_.qid))); - Get["/topic/{tid}/{sid}"] = - _ => _modelCreator.Build(new SubscriptionCriteria(To.String((object)_.tid), To.String((object)_.sid), true)); - Get["queue/{qid}/messages/{count}"] = - _ => _modelCreator.Build(new FindQueuedMessages(To.String((object)_.qid).UnescapePathName(), To.Int(_.count))); - Get["topic/{tid}/{sid}/messages/{count}"] = - _ => _modelCreator.Build(new FindSubscriptionMessages(To.String((object)_.tid), To.String((object)_.sid).UnescapePathName(), To.Int(_.count))); - Post["/queue/{qid}/requeue/all"] = _ => + Get["/deadletters", true] = + async (_, ct) => await _modelCreator.Build(); + Get["/topic/{tid}", true] = + async (_, ct) => await _modelCreator.Build(new TopicCriteria(To.String((object)_.tid))); + Get["/queue/{qid}", true] = + async (_, ct) => await _modelCreator.Build(new QueueCriteria(To.String((object)_.qid))); + Get["/topic/{tid}/{sid}", true] = + async (_, ct) => await _modelCreator.Build(new SubscriptionCriteria(To.String((object)_.tid), To.String((object)_.sid), true)); + Get["queue/{qid}/messages/{count}", true] = + async (_, ct) => await _modelCreator.Build(new FindQueuedMessages(To.String((object)_.qid).UnescapePathName(), To.Int(_.count))); + Get["topic/{tid}/{sid}/messages/{count}", true] = + async (_, ct) => await _modelCreator.Build(new FindSubscriptionMessages(To.String((object)_.tid), To.String((object)_.sid).UnescapePathName(), To.Int(_.count))); + Post["/queue/{qid}/requeue/all", true] = async (_, ct) => { var qid = To.String((object)_.qid).UnescapePathName(); - _requeueAndRemove.RequeueAll(qid); + await _requeueAndRemove.RequeueAll(qid); return _modelCreator.Build(new QueueCriteria(qid.RemoveDeadLetterPath(), true)); }; - Post["/topic/{tid}/{sid}/requeue/all"] = _ => + Post["/topic/{tid}/{sid}/requeue/all", true] = async (_, ct) => { var tid = To.String((object)_.tid); var sid = To.String((object)_.sid).UnescapePathName(); - _requeueAndRemove.RequeueAll(tid, sid); + await _requeueAndRemove.RequeueAll(tid, sid); return _modelCreator.Build(new SubscriptionCriteria(tid, sid.RemoveDeadLetterPath(), true)); }; - Post["/queue/{qid}/remove/all"] = _ => + Post["/queue/{qid}/remove/all", true] = async (_, ct) => { var qid = To.String((object)_.qid).UnescapePathName(); - _requeueAndRemove.RemoveAll(qid); + await _requeueAndRemove.RemoveAll(qid); return _modelCreator.Build(new QueueCriteria(qid.RemoveDeadLetterPath(), true)); }; - Post["/topic/{tid}/{sid}/remove/all"] = _ => + Post["/topic/{tid}/{sid}/remove/all", true] = async (_, ct) => { var tid = To.String((object)_.tid); var sid = To.String((object)_.sid).UnescapePathName(); - _requeueAndRemove.RemoveAll(tid, sid); + await _requeueAndRemove.RemoveAll(tid, sid); return _modelCreator.Build(new SubscriptionCriteria(tid, sid.RemoveDeadLetterPath(), true)); }; - Post["queue/{qid}/delete"] = - _ => { - _commandSender.Send(new DeleteQueueCommand(To.String((object)_.qid).UnescapePathName().RemoveDeadLetterPath())); - _commandSender.Send(new RefreshCachedOverviewCommand()); + Post["queue/{qid}/delete", true] = + async (_, ct) => { + await _commandSender.Send(new DeleteQueueCommand(To.String((object)_.qid).UnescapePathName().RemoveDeadLetterPath())); + await _commandSender.Send(new RefreshCachedOverviewCommand()); return new { success = true }; }; - Post["topic/{tid}/delete"] = - _ => { - _commandSender.Send(new DeleteTopicCommand(To.String((object)_.tid).UnescapePathName())); - _commandSender.Send(new RefreshCachedOverviewCommand()); + Post["topic/{tid}/delete", true] = + async (_, ct) => { + await _commandSender.Send(new DeleteTopicCommand(To.String((object)_.tid).UnescapePathName())); + await _commandSender.Send(new RefreshCachedOverviewCommand()); return new { success = true }; }; - Post["topic/{tid}/{sid}/delete"] = - _ => { - _commandSender.Send(new DeleteSubscriptionCommand(To.String((object)_.tid).UnescapePathName(), To.String((object)_.sid).UnescapePathName().RemoveDeadLetterPath())); - _commandSender.Send(new RefreshCachedOverviewCommand()); + Post["topic/{tid}/{sid}/delete", true] = + async (_, ct) => { + await _commandSender.Send(new DeleteSubscriptionCommand(To.String((object)_.tid).UnescapePathName(), To.String((object)_.sid).UnescapePathName().RemoveDeadLetterPath())); + await _commandSender.Send(new RefreshCachedOverviewCommand()); return new { success = true }; }; - Post["queue/{qid}/remove"] = - _ => { _commandSender.Send(new RemoveMessageCommand(Request.Form.messageId, To.String((object)_.qid).UnescapePathName())); return new { success = true }; }; - Post["queue/{qid}/dead/{mid}"] = - _ => { _commandSender.Send(new DeadLetterMessageCommand(To.String((object)_.mid), To.String((object)_.qid).UnescapePathName())); return new { success = true }; }; - Post["queue/{qid}/dead"] = - _ => + Post["queue/{qid}/remove", true] = + async (_, ct) => { await _commandSender.Send(new RemoveMessageCommand(Request.Form.messageId, To.String((object)_.qid).UnescapePathName())); return new { success = true }; }; + Post["queue/{qid}/dead/{mid}", true] = + async (_, ct) => { await _commandSender.Send(new DeadLetterMessageCommand(To.String((object)_.mid), To.String((object)_.qid).UnescapePathName())); return new { success = true }; }; + Post["queue/{qid}/dead", true] = + async (_, ct) => { - _commandSender.Send(new DeadLetterAllMessagesCommand(To.String((object)_.qid).UnescapePathName())); + await _commandSender.Send(new DeadLetterAllMessagesCommand(To.String((object)_.qid).UnescapePathName())); return _modelCreator.Build(new QueueCriteria(To.String((object)_.qid).RemoveDeadLetterPath(), true)); }; - Post["queue/{qid}/requeue"] = - _ => { _commandSender.Send(new RequeueMessageCommand(Request.Form.messageId, To.String((object)_.qid).UnescapePathName())); return new { success = true }; }; - Post["queue/{qid}/requeueModified"] = - _ => { _commandSender.Send(new RequeueMessageCommand(Request.Form.messageId, To.String((object)_.qid).UnescapePathName()) { NewBody = Request.Form.body}); return new { success = true }; }; - Post["topic/{tid}/{sid}/remove"] = - _ => { _commandSender.Send(new RemoveMessageCommand(Request.Form.messageId, To.String((object)_.tid), To.String((object)_.sid).UnescapePathName())); return new { success = true }; }; - Post["topic/{tid}/{sid}/dead/{mid}"] = - _ => { _commandSender.Send(new DeadLetterMessageCommand(To.String((object)_.mid), To.String((object)_.tid), To.String((object)_.sid).UnescapePathName())); return new { success = true }; }; - Post["topic/{tid}/{sid}/dead"] = - _ => + Post["queue/{qid}/requeue", true] = + async (_, ct) => { await _commandSender.Send(new RequeueMessageCommand(Request.Form.messageId, To.String((object)_.qid).UnescapePathName())); return new { success = true }; }; + Post["queue/{qid}/requeueModified", true] = + async (_, ct) => { await _commandSender.Send(new RequeueMessageCommand(Request.Form.messageId, To.String((object)_.qid).UnescapePathName()) { NewBody = Request.Form.body}); return new { success = true }; }; + Post["topic/{tid}/{sid}/remove", true] = + async (_, ct) => { await _commandSender.Send(new RemoveMessageCommand(Request.Form.messageId, To.String((object)_.tid), To.String((object)_.sid).UnescapePathName())); return new { success = true }; }; + Post["topic/{tid}/{sid}/dead/{mid}", true] = + async (_, ct) => { await _commandSender.Send(new DeadLetterMessageCommand(To.String((object)_.mid), To.String((object)_.tid), To.String((object)_.sid).UnescapePathName())); return new { success = true }; }; + Post["topic/{tid}/{sid}/dead", true] = + async (_, ct) => { - _commandSender.Send(new DeadLetterAllMessagesCommand(To.String((object)_.tid), To.String((object)_.sid).UnescapePathName())); + await _commandSender.Send(new DeadLetterAllMessagesCommand(To.String((object)_.tid), To.String((object)_.sid).UnescapePathName())); return _modelCreator.Build(new SubscriptionCriteria(To.String((object)_.tid), To.String((object)_.sid).UnescapePathName(), true)); }; - Post["topic/{tid}/{sid}/requeue"] = - _ => { _commandSender.Send(new RequeueMessageCommand(Request.Form.messageId,To.String( _.tid), To.String((object)_.sid).UnescapePathName())); return new { success = true }; }; - Post["topic/{tid}/{sid}/requeueModified"] = - _ => { _commandSender.Send(new RequeueMessageCommand(Request.Form.messageId, To.String(_.tid), To.String((object)_.sid).UnescapePathName()) { NewBody = Request.Form.body }); return new { success = true }; }; + Post["topic/{tid}/{sid}/requeue", true] = + async (_, ct) => { await _commandSender.Send(new RequeueMessageCommand(Request.Form.messageId,To.String( _.tid), To.String((object)_.sid).UnescapePathName())); return new { success = true }; }; + Post["topic/{tid}/{sid}/requeueModified", true] = + async (_, ct) => { await _commandSender.Send(new RequeueMessageCommand(Request.Form.messageId, To.String(_.tid), To.String((object)_.sid).UnescapePathName()) { NewBody = Request.Form.body }); return new { success = true }; }; - Post["queue/{qid}"] = - _ => { _commandSender.Send(new SendMessageCommand(To.String((object)_.qid).UnescapePathName(), this.Bind())); return new { success = true }; }; - Post["topic/{tid}"] = - _ => { _commandSender.Send(new PublishMessageCommand(To.String((object)_.tid).UnescapePathName(), this.Bind())); return new { success = true }; }; + Post["queue/{qid}", true] = + async (_, ct) => { await _commandSender.Send(new SendMessageCommand(To.String((object)_.qid).UnescapePathName(), this.Bind())); return new { success = true }; }; + Post["topic/{tid}", true] = + async (_, ct) => { await _commandSender.Send(new PublishMessageCommand(To.String((object)_.tid).UnescapePathName(), this.Bind())); return new { success = true }; }; } } diff --git a/src/SbManager/InternalCommandHandlers/DeadLetterAllMessagesCommandHandler.cs b/src/SbManager/InternalCommandHandlers/DeadLetterAllMessagesCommandHandler.cs index 84eda72..a0eb0bd 100644 --- a/src/SbManager/InternalCommandHandlers/DeadLetterAllMessagesCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/DeadLetterAllMessagesCommandHandler.cs @@ -1,4 +1,5 @@ -using SbManager.BusHelpers; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.CQRS.Commands; namespace SbManager.InternalCommandHandlers @@ -29,12 +30,12 @@ public DeadLetterAllMessagesCommandHandler(IRequeueAndRemove requeueAndRemove) _requeueAndRemove = requeueAndRemove; } - public void Execute(DeadLetterAllMessagesCommand command) + public async Task Execute(DeadLetterAllMessagesCommand command) { if (command.Queue != null) - _requeueAndRemove.KillAll(command.Queue); + await _requeueAndRemove.KillAll(command.Queue); else - _requeueAndRemove.KillAll(command.TopicName, command.Subscription); + await _requeueAndRemove.KillAll(command.TopicName, command.Subscription); } } } diff --git a/src/SbManager/InternalCommandHandlers/DeadLetterMessageCommandHandler.cs b/src/SbManager/InternalCommandHandlers/DeadLetterMessageCommandHandler.cs index 9c02c58..2a411a3 100644 --- a/src/SbManager/InternalCommandHandlers/DeadLetterMessageCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/DeadLetterMessageCommandHandler.cs @@ -1,4 +1,5 @@ -using SbManager.BusHelpers; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.CQRS.Commands; namespace SbManager.InternalCommandHandlers @@ -32,12 +33,12 @@ public DeadLetterMessageCommandHandler(IRequeueAndRemove requeueAndRemove) _requeueAndRemove = requeueAndRemove; } - public void Execute(DeadLetterMessageCommand command) + public async Task Execute(DeadLetterMessageCommand command) { if (command.Queue != null) - _requeueAndRemove.Kill(command.Queue, command.MessageId); + await _requeueAndRemove.KillOne(command.Queue, command.MessageId); else - _requeueAndRemove.Kill(command.TopicName, command.Subscription, command.MessageId); + await _requeueAndRemove.KillOne(command.TopicName, command.Subscription, command.MessageId); } } } diff --git a/src/SbManager/InternalCommandHandlers/DeleteAllBusEntititesCommandHandler.cs b/src/SbManager/InternalCommandHandlers/DeleteAllBusEntititesCommandHandler.cs index 8752eb8..32c3d9d 100644 --- a/src/SbManager/InternalCommandHandlers/DeleteAllBusEntititesCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/DeleteAllBusEntititesCommandHandler.cs @@ -1,5 +1,5 @@ -using System.Linq; -using Microsoft.ServiceBus; +using System.Threading.Tasks; +using Mossharbor.AzureWorkArounds.ServiceBus; using SbManager.CQRS.Commands; namespace SbManager.InternalCommandHandlers @@ -15,10 +15,11 @@ public DeleteAllBusEntititesCommandHandler(NamespaceManager namespaceManager) _namespaceManager = namespaceManager; } - public void Execute(DeleteAllBusEntititesCommand command) + public Task Execute(DeleteAllBusEntititesCommand command) { - foreach(var q in _namespaceManager.GetQueues().ToArray()) _namespaceManager.DeleteQueue(q.Path); - foreach(var t in _namespaceManager.GetTopics().ToArray()) _namespaceManager.DeleteTopic(t.Path); + foreach(var q in _namespaceManager.GetQueues()) _namespaceManager.DeleteQueue(q.Path); + foreach(var t in _namespaceManager.GetTopics()) _namespaceManager.DeleteTopic(t.Path); + return Task.CompletedTask; } } } diff --git a/src/SbManager/InternalCommandHandlers/DeleteAllDeadLettersCommandHandler.cs b/src/SbManager/InternalCommandHandlers/DeleteAllDeadLettersCommandHandler.cs index 83db1c6..dcc2c4c 100644 --- a/src/SbManager/InternalCommandHandlers/DeleteAllDeadLettersCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/DeleteAllDeadLettersCommandHandler.cs @@ -1,6 +1,6 @@ using System.Linq; -using System.ServiceModel; -using Microsoft.ServiceBus; +using System.Threading.Tasks; +using Mossharbor.AzureWorkArounds.ServiceBus; using SbManager.BusHelpers; using SbManager.CQRS.Commands; @@ -21,7 +21,7 @@ public DeleteAllDeadLettersCommandHandler(NamespaceManager namespaceManager, IRe _requeueAndRemove = requeueAndRemove; } - public void Execute(DeleteAllDeadLettersCommand command) + public async Task Execute(DeleteAllDeadLettersCommand command) { var topics = _namespaceManager.GetTopics().ToArray(); foreach (var topic in topics) @@ -29,14 +29,14 @@ public void Execute(DeleteAllDeadLettersCommand command) var subscriptions = _namespaceManager.GetSubscriptions(topic.Path); foreach (var subscription in subscriptions) { - _requeueAndRemove.RemoveAll(topic.Path, subscription.Name + DeadLetterQueueSuffix); + await _requeueAndRemove.RemoveAll(topic.Path, subscription.Name + DeadLetterQueueSuffix); } } var queues = _namespaceManager.GetQueues().ToArray(); foreach (var queue in queues) { - _requeueAndRemove.RemoveAll(queue.Path + DeadLetterQueueSuffix); + await _requeueAndRemove.RemoveAll(queue.Path + DeadLetterQueueSuffix); } } } diff --git a/src/SbManager/InternalCommandHandlers/DeleteQueueCommandHandler.cs b/src/SbManager/InternalCommandHandlers/DeleteQueueCommandHandler.cs index 88d1046..f45ef06 100644 --- a/src/SbManager/InternalCommandHandlers/DeleteQueueCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/DeleteQueueCommandHandler.cs @@ -1,4 +1,5 @@ -using Microsoft.ServiceBus; +using System.Threading.Tasks; +using Mossharbor.AzureWorkArounds.ServiceBus; using SbManager.CQRS.Commands; namespace SbManager.InternalCommandHandlers @@ -21,9 +22,10 @@ public DeleteQueueCommandHandler(NamespaceManager namespaceManager) _namespaceManager = namespaceManager; } - public void Execute(DeleteQueueCommand command) + public Task Execute(DeleteQueueCommand command) { _namespaceManager.DeleteQueue(command.Path); + return Task.CompletedTask; } } } diff --git a/src/SbManager/InternalCommandHandlers/DeleteSubscriptionCommandHandler.cs b/src/SbManager/InternalCommandHandlers/DeleteSubscriptionCommandHandler.cs index 0e716cd..44de55d 100644 --- a/src/SbManager/InternalCommandHandlers/DeleteSubscriptionCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/DeleteSubscriptionCommandHandler.cs @@ -1,4 +1,5 @@ -using Microsoft.ServiceBus; +using System.Threading.Tasks; +using Mossharbor.AzureWorkArounds.ServiceBus; using SbManager.CQRS.Commands; namespace SbManager.InternalCommandHandlers @@ -23,9 +24,10 @@ public DeleteSubscriptionCommandHandler(NamespaceManager namespaceManager) _namespaceManager = namespaceManager; } - public void Execute(DeleteSubscriptionCommand command) + public Task Execute(DeleteSubscriptionCommand command) { _namespaceManager.DeleteSubscription(command.Topic, command.Path); + return Task.CompletedTask; } } } diff --git a/src/SbManager/InternalCommandHandlers/DeleteTopicCommandHandler.cs b/src/SbManager/InternalCommandHandlers/DeleteTopicCommandHandler.cs index 2bc9c84..4dc03a4 100644 --- a/src/SbManager/InternalCommandHandlers/DeleteTopicCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/DeleteTopicCommandHandler.cs @@ -1,4 +1,5 @@ -using Microsoft.ServiceBus; +using System.Threading.Tasks; +using Mossharbor.AzureWorkArounds.ServiceBus; using SbManager.CQRS.Commands; namespace SbManager.InternalCommandHandlers @@ -21,9 +22,10 @@ public DeleteTopicCommandHandler(NamespaceManager namespaceManager) _namespaceManager = namespaceManager; } - public void Execute(DeleteTopicCommand command) + public Task Execute(DeleteTopicCommand command) { _namespaceManager.DeleteTopic(command.Path); + return Task.CompletedTask; } } } diff --git a/src/SbManager/InternalCommandHandlers/PublishMessageCommandHandler.cs b/src/SbManager/InternalCommandHandlers/PublishMessageCommandHandler.cs index ce51144..72e31b8 100644 --- a/src/SbManager/InternalCommandHandlers/PublishMessageCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/PublishMessageCommandHandler.cs @@ -1,4 +1,5 @@ -using SbManager.BusHelpers; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.CQRS.Commands; using SbManager.Models.ViewModels; @@ -24,9 +25,9 @@ public PublishMessageCommandHandler(ISender sender) _sender = sender; } - public void Execute(PublishMessageCommand command) + public async Task Execute(PublishMessageCommand command) { - _sender.Publish(command.Message, command.Topic); + await _sender.Publish(command.Message, command.Topic); } } } diff --git a/src/SbManager/InternalCommandHandlers/RefreshCachedOverviewCommandHandler.cs b/src/SbManager/InternalCommandHandlers/RefreshCachedOverviewCommandHandler.cs index d4c5f03..e6061ee 100644 --- a/src/SbManager/InternalCommandHandlers/RefreshCachedOverviewCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/RefreshCachedOverviewCommandHandler.cs @@ -1,4 +1,5 @@ -using SbManager.BusHelpers; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.CQRS.Commands; namespace SbManager.InternalCommandHandlers @@ -13,9 +14,9 @@ public RefreshCachedOverviewCommandHandler(IBusMonitor busMonitor) { _busMonitor = busMonitor; } - public void Execute(RefreshCachedOverviewCommand command) + public async Task Execute(RefreshCachedOverviewCommand command) { - _busMonitor.GetOverview(true); + await _busMonitor.GetOverview(true); } } } diff --git a/src/SbManager/InternalCommandHandlers/RemoveMessageCommandHandler.cs b/src/SbManager/InternalCommandHandlers/RemoveMessageCommandHandler.cs index 4fdca83..2b56bb1 100644 --- a/src/SbManager/InternalCommandHandlers/RemoveMessageCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/RemoveMessageCommandHandler.cs @@ -1,4 +1,5 @@ -using SbManager.BusHelpers; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.CQRS.Commands; namespace SbManager.InternalCommandHandlers @@ -32,12 +33,12 @@ public RemoveMessageCommandHandler(IRequeueAndRemove requeueAndRemove) _requeueAndRemove = requeueAndRemove; } - public void Execute(RemoveMessageCommand command) + public async Task Execute(RemoveMessageCommand command) { if (command.Queue != null) - _requeueAndRemove.RemoveOne(command.Queue, command.MessageId); + await _requeueAndRemove.RemoveOne(command.Queue, command.MessageId); else - _requeueAndRemove.RemoveOne(command.TopicName, command.Subscription, command.MessageId); + await _requeueAndRemove.RemoveOne(command.TopicName, command.Subscription, command.MessageId); } } } diff --git a/src/SbManager/InternalCommandHandlers/RequeueMessageCommandHandler'.cs b/src/SbManager/InternalCommandHandlers/RequeueMessageCommandHandler'.cs index b765a29..0722b71 100644 --- a/src/SbManager/InternalCommandHandlers/RequeueMessageCommandHandler'.cs +++ b/src/SbManager/InternalCommandHandlers/RequeueMessageCommandHandler'.cs @@ -1,4 +1,5 @@ -using SbManager.BusHelpers; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.CQRS.Commands; namespace SbManager.InternalCommandHandlers @@ -33,12 +34,12 @@ public RequeueMessageCommandHandler(IRequeueAndRemove requeueAndRemove) _requeueAndRemove = requeueAndRemove; } - public void Execute(RequeueMessageCommand command) + public async Task Execute(RequeueMessageCommand command) { if (command.Queue != null) - _requeueAndRemove.RequeueOne(command.Queue, command.MessageId, command.NewBody); + await _requeueAndRemove.RequeueOne(command.Queue, command.MessageId, command.NewBody); else - _requeueAndRemove.RequeueOne(command.TopicName, command.Subscription, command.MessageId, command.NewBody); + await _requeueAndRemove.RequeueOne(command.TopicName, command.Subscription, command.MessageId, command.NewBody); } } } diff --git a/src/SbManager/InternalCommandHandlers/SendMessageCommandHandler.cs b/src/SbManager/InternalCommandHandlers/SendMessageCommandHandler.cs index e4a17ce..0fddd5b 100644 --- a/src/SbManager/InternalCommandHandlers/SendMessageCommandHandler.cs +++ b/src/SbManager/InternalCommandHandlers/SendMessageCommandHandler.cs @@ -1,4 +1,5 @@ -using SbManager.BusHelpers; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.CQRS.Commands; using SbManager.Models.ViewModels; @@ -24,9 +25,9 @@ public SendMessageCommandHandler(ISender sender) _sender = sender; } - public void Execute(SendMessageCommand command) + public async Task Execute(SendMessageCommand command) { - _sender.Send(command.Message, command.Queue); + await _sender.Send(command.Message, command.Queue); } } } diff --git a/src/SbManager/Models/ViewModelBuilders/DeadletterViewBuilder.cs b/src/SbManager/Models/ViewModelBuilders/DeadletterViewBuilder.cs index 9d7038b..1bc611c 100644 --- a/src/SbManager/Models/ViewModelBuilders/DeadletterViewBuilder.cs +++ b/src/SbManager/Models/ViewModelBuilders/DeadletterViewBuilder.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Threading.Tasks; using SbManager.BusHelpers; using SbManager.CQRS.ModelBuilders; using SbManager.Models.ViewModels; @@ -16,9 +17,9 @@ public DeadletterViewBuilder(IBusMonitor busMonitor, IConfig config) _busMonitor = busMonitor; } - public DeadletterView Build() + public async Task Build() { - var overview = _busMonitor.GetOverview(true); + var overview = await _busMonitor.GetOverview(true); var deadletterQueues = overview.Queues.Where(q => q.DeadLetterCount > 0) .Select(q => new Deadletter { diff --git a/src/SbManager/Models/ViewModelBuilders/OverviewModelBuilder.cs b/src/SbManager/Models/ViewModelBuilders/OverviewModelBuilder.cs index 880de55..9cae96f 100644 --- a/src/SbManager/Models/ViewModelBuilders/OverviewModelBuilder.cs +++ b/src/SbManager/Models/ViewModelBuilders/OverviewModelBuilder.cs @@ -1,4 +1,5 @@ -using SbManager.BusHelpers; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.Models.ViewModels; namespace SbManager.Models.ViewModelBuilders @@ -11,9 +12,9 @@ public OverviewModelBuilder(IBusMonitor busMonitor) { _busMonitor = busMonitor; } - public Overview Build() + public async Task Build() { - return _busMonitor.GetOverview(); + return await _busMonitor.GetOverview(); } } } diff --git a/src/SbManager/Models/ViewModelBuilders/QueueMessagesBuilder.cs b/src/SbManager/Models/ViewModelBuilders/QueueMessagesBuilder.cs index b5769a0..62a6556 100644 --- a/src/SbManager/Models/ViewModelBuilders/QueueMessagesBuilder.cs +++ b/src/SbManager/Models/ViewModelBuilders/QueueMessagesBuilder.cs @@ -1,5 +1,6 @@ using System.Linq; -using Microsoft.ServiceBus.Messaging; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.Extensions; using SbManager.Models.ViewModels; @@ -26,11 +27,11 @@ public QueueMessagesBuilder(MessagingFactory messagingFactory) _messagingFactory = messagingFactory; } - public MessageView Build(FindQueuedMessages criteria) + public async Task Build(FindQueuedMessages criteria) { - var client = _messagingFactory.CreateQueueClient(criteria.Path); + var receiver = _messagingFactory.CreateMessageReceiver(criteria.Path); var resp = new MessageView(); - var msgs = client.PeekBatch(criteria.Count); + var msgs = await receiver.PeekAsync(criteria.Count); foreach (var m in msgs) { @@ -39,25 +40,23 @@ public MessageView Build(FindQueuedMessages criteria) msg.MessageId = m.MessageId; msg.CorrelationId = m.CorrelationId; - msg.Enqueued = m.EnqueuedTimeUtc; + msg.Enqueued = m.SystemProperties.EnqueuedTimeUtc; msg.Expires = m.ExpiresAtUtc; msg.Label = m.Label; - msg.Sequence = m.SequenceNumber; - msg.EnqueuedSequence = m.EnqueuedSequenceNumber; + msg.Sequence = m.SystemProperties.SequenceNumber; + msg.EnqueuedSequence = m.SystemProperties.EnqueuedSequenceNumber; msg.SizeInBytes = m.Size; msg.ReplyTo = m.ReplyTo; msg.ReplyToSessionId = m.ReplyToSessionId; msg.To = m.To; msg.SessionId = m.SessionId; - msg.State = m.State.ToString(); - if (criteria.HaveLock) msg.LockToken = m.LockToken.ToString(); - if (criteria.HaveLock) msg.LockedUntil = m.LockedUntilUtc; + if (criteria.HaveLock) msg.LockToken = m.SystemProperties.LockToken; + if (criteria.HaveLock) msg.LockedUntil = m.SystemProperties.LockedUntilUtc; msg.TimeToLive = m.TimeToLive; msg.ScheduledEnqueueTime = m.ScheduledEnqueueTimeUtc; msg.ContentType = m.ContentType; - msg.IsBodyConsumed = m.IsBodyConsumed; - msg.DeliveryCount = m.DeliveryCount; - msg.CustomProperties = m.Properties.ToDictionary(kvp => kvp.Key, kvp => kvp.Value == null ? null : kvp.Value.ToString()); + msg.DeliveryCount = m.SystemProperties.DeliveryCount; + msg.CustomProperties = m.UserProperties.ToDictionary(kvp => kvp.Key, kvp => kvp.Value?.ToString()); msg.Body = m.GetBodyString(); resp.Messages.Add(msg); diff --git a/src/SbManager/Models/ViewModelBuilders/QueueModelBuilder.cs b/src/SbManager/Models/ViewModelBuilders/QueueModelBuilder.cs index 52e80d1..641575b 100644 --- a/src/SbManager/Models/ViewModelBuilders/QueueModelBuilder.cs +++ b/src/SbManager/Models/ViewModelBuilders/QueueModelBuilder.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Threading.Tasks; using SbManager.BusHelpers; using SbManager.Models.ViewModels; @@ -25,9 +26,9 @@ public QueueModelBuilder(IBusMonitor busMonitor) _busMonitor = busMonitor; } - public Queue Build(QueueCriteria criteria) + public async Task Build(QueueCriteria criteria) { - return _busMonitor.GetOverview(criteria.RequireFresh).Queues.Single(q => String.Equals(q.Name, criteria.Queue, StringComparison.CurrentCultureIgnoreCase)); + return (await _busMonitor.GetOverview(criteria.RequireFresh)).Queues.Single(q => String.Equals(q.Name, criteria.Queue, StringComparison.CurrentCultureIgnoreCase)); } } } diff --git a/src/SbManager/Models/ViewModelBuilders/SubscriptionMessagesBuilder.cs b/src/SbManager/Models/ViewModelBuilders/SubscriptionMessagesBuilder.cs index c795e9a..ad23c94 100644 --- a/src/SbManager/Models/ViewModelBuilders/SubscriptionMessagesBuilder.cs +++ b/src/SbManager/Models/ViewModelBuilders/SubscriptionMessagesBuilder.cs @@ -1,7 +1,9 @@ using System.Linq; -using Microsoft.ServiceBus.Messaging; +using System.Threading.Tasks; +using SbManager.BusHelpers; using SbManager.Extensions; using SbManager.Models.ViewModels; +using static Microsoft.Azure.ServiceBus.EntityNameHelper; namespace SbManager.Models.ViewModelBuilders { @@ -28,11 +30,11 @@ public SubscriptionMessagesBuilder(MessagingFactory messagingFactory) _messagingFactory = messagingFactory; } - public MessageView Build(FindSubscriptionMessages criteria) + public async Task Build(FindSubscriptionMessages criteria) { - var client = _messagingFactory.CreateSubscriptionClient(criteria.Topic, criteria.Path); + var receiver = _messagingFactory.CreateMessageReceiver(FormatSubscriptionPath(criteria.Topic, criteria.Path)); var resp = new MessageView(); - var msgs = client.PeekBatch(criteria.Count); + var msgs = await receiver.PeekAsync(criteria.Count); foreach(var m in msgs) { @@ -41,25 +43,23 @@ public MessageView Build(FindSubscriptionMessages criteria) msg.MessageId = m.MessageId; msg.CorrelationId = m.CorrelationId; - msg.Enqueued = m.EnqueuedTimeUtc; + msg.Enqueued = m.SystemProperties.EnqueuedTimeUtc; msg.Expires = m.ExpiresAtUtc; msg.Label = m.Label; - msg.Sequence = m.SequenceNumber; - msg.EnqueuedSequence = m.EnqueuedSequenceNumber; + msg.Sequence = m.SystemProperties.SequenceNumber; + msg.EnqueuedSequence = m.SystemProperties.EnqueuedSequenceNumber; msg.SizeInBytes = m.Size; msg.ReplyTo = m.ReplyTo; msg.ReplyToSessionId = m.ReplyToSessionId; msg.To = m.To; msg.SessionId = m.SessionId; - msg.State = m.State.ToString(); - if (criteria.HaveLock) msg.LockToken = m.LockToken.ToString(); - if (criteria.HaveLock) msg.LockedUntil = m.LockedUntilUtc; + if (criteria.HaveLock) msg.LockToken = m.SystemProperties.LockToken; + if (criteria.HaveLock) msg.LockedUntil = m.SystemProperties.LockedUntilUtc; msg.TimeToLive = m.TimeToLive; msg.ScheduledEnqueueTime = m.ScheduledEnqueueTimeUtc; msg.ContentType = m.ContentType; - msg.IsBodyConsumed = m.IsBodyConsumed; - msg.DeliveryCount = m.DeliveryCount; - msg.CustomProperties = m.Properties.ToDictionary(kvp => kvp.Key, kvp => kvp.Value == null ? null : kvp.Value.ToString()); + msg.DeliveryCount = m.SystemProperties.DeliveryCount; + msg.CustomProperties = m.UserProperties.ToDictionary(kvp => kvp.Key, kvp => kvp.Value?.ToString()); msg.Body = m.GetBodyString(); resp.Messages.Add(msg); diff --git a/src/SbManager/Models/ViewModelBuilders/SubscriptionModelBuilder.cs b/src/SbManager/Models/ViewModelBuilders/SubscriptionModelBuilder.cs index 7ef6012..41a5477 100644 --- a/src/SbManager/Models/ViewModelBuilders/SubscriptionModelBuilder.cs +++ b/src/SbManager/Models/ViewModelBuilders/SubscriptionModelBuilder.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Threading.Tasks; using SbManager.BusHelpers; using SbManager.Models.ViewModels; @@ -27,9 +28,9 @@ public SubscriptionModelBuilder(IBusMonitor busMonitor) _busMonitor = busMonitor; } - public Subscription Build(SubscriptionCriteria criteria) + public async Task Build(SubscriptionCriteria criteria) { - return _busMonitor.GetOverview(criteria.RequireFresh) + return (await _busMonitor.GetOverview(criteria.RequireFresh)) .Topics.Single(t => String.Equals(t.Name, criteria.Topic, StringComparison.CurrentCultureIgnoreCase)) .Subscriptions.Single(s => String.Equals(s.Name, criteria.Subscription, StringComparison.CurrentCultureIgnoreCase)); } diff --git a/src/SbManager/Models/ViewModelBuilders/TopicModelBuilder.cs b/src/SbManager/Models/ViewModelBuilders/TopicModelBuilder.cs index bb07ff2..10df0ad 100644 --- a/src/SbManager/Models/ViewModelBuilders/TopicModelBuilder.cs +++ b/src/SbManager/Models/ViewModelBuilders/TopicModelBuilder.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Threading.Tasks; using SbManager.BusHelpers; using SbManager.Models.ViewModels; @@ -24,9 +25,9 @@ public TopicModelBuilder(IBusMonitor busMonitor) _busMonitor = busMonitor; } - public Topic Build(TopicCriteria criteria) + public async Task Build(TopicCriteria criteria) { - return _busMonitor.GetOverview(criteria.RequireFresh).Topics.Single(t => String.Equals(t.Name, criteria.Topic, StringComparison.CurrentCultureIgnoreCase)); + return (await _busMonitor.GetOverview(criteria.RequireFresh)).Topics.Single(t => String.Equals(t.Name, criteria.Topic, StringComparison.CurrentCultureIgnoreCase)); } } } diff --git a/src/SbManager/Models/ViewModels/MessageView.cs b/src/SbManager/Models/ViewModels/MessageView.cs index 19e2cb4..45d6d54 100644 --- a/src/SbManager/Models/ViewModels/MessageView.cs +++ b/src/SbManager/Models/ViewModels/MessageView.cs @@ -26,14 +26,12 @@ public class Message public string ContentType { get; set; } public int DeliveryCount { get; set; } - public bool IsBodyConsumed { get; set; } public DateTime LockedUntil { get; set; } public string LockToken { get; set; } public string ReplyTo { get; set; } public string ReplyToSessionId { get; set; } public DateTime ScheduledEnqueueTime { get; set; } public string SessionId { get; set; } - public string State { get; set; } public TimeSpan TimeToLive { get; set; } public string To { get; set; } } diff --git a/src/SbManager/SbManager.csproj b/src/SbManager/SbManager.csproj index 6290533..ce3a121 100644 --- a/src/SbManager/SbManager.csproj +++ b/src/SbManager/SbManager.csproj @@ -9,7 +9,7 @@ Properties SbManager SbManager - v4.6 + v4.7.1 512 true ..\ @@ -64,6 +64,34 @@ ..\packages\Humanizer.Core.2.1.0\lib\netstandard1.0\Humanizer.dll True + + ..\packages\Microsoft.Azure.Amqp.2.2.0\lib\net45\Microsoft.Azure.Amqp.dll + True + + + ..\packages\Microsoft.Azure.ServiceBus.3.0.1.16\lib\netstandard2.0\Microsoft.Azure.ServiceBus.dll + True + + + ..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.1\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll + True + + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.17.2\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + True + + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.17.2\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll + True + + + ..\packages\Microsoft.IdentityModel.Logging.5.2.2\lib\net451\Microsoft.IdentityModel.Logging.dll + True + + + ..\packages\Microsoft.IdentityModel.Tokens.5.2.2\lib\net451\Microsoft.IdentityModel.Tokens.dll + True + False ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll @@ -96,13 +124,13 @@ False ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll - - False - ..\packages\WindowsAzure.ServiceBus.2.1.4.0\lib\net40-full\Microsoft.ServiceBus.dll - ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + ..\..\..\AzureWorkArounds.ServiceBus\Mossharbor.AzureWorkArounds.ServiceBus\bin\Debug\netstandard2.0\Mossharbor.AzureWorkArounds.ServiceBus.dll + + ..\packages\Nancy.1.4.3\lib\net40\Nancy.dll True @@ -119,8 +147,8 @@ ..\packages\Nancy.Serialization.JsonNet.1.4.1\lib\net40\Nancy.Serialization.JsonNet.dll True - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll True @@ -147,10 +175,59 @@ True + + + ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll + True + + + ..\packages\System.IdentityModel.Tokens.Jwt.5.2.2\lib\net451\System.IdentityModel.Tokens.Jwt.dll + True + + + ..\packages\System.IO.4.1.0\lib\net462\System.IO.dll + True + + + ..\packages\System.Net.WebSockets.4.0.0\lib\net46\System.Net.WebSockets.dll + True + + + ..\packages\System.Net.WebSockets.Client.4.0.0\lib\net46\System.Net.WebSockets.Client.dll + True + + + ..\packages\System.Runtime.4.1.0\lib\net462\System.Runtime.dll + True + + + ..\packages\System.Runtime.Serialization.Primitives.4.3.0\lib\net46\System.Runtime.Serialization.Primitives.dll + True + + + ..\packages\System.Runtime.Serialization.Xml.4.3.0\lib\net46\System.Runtime.Serialization.Xml.dll + True + + + ..\packages\System.Security.Cryptography.Algorithms.4.2.0\lib\net463\System.Security.Cryptography.Algorithms.dll + True + + + ..\packages\System.Security.Cryptography.Encoding.4.0.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + + + ..\packages\System.Security.Cryptography.Primitives.4.0.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + + + ..\packages\System.Security.Cryptography.X509Certificates.4.1.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + @@ -181,6 +258,7 @@ GlobalAssemblyInfo.cs + @@ -406,12 +484,14 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + \ No newline at end of file diff --git a/src/SbManager.IntegrationTests/app.config b/src/SbManager.IntegrationTests/app.config deleted file mode 100644 index 980270c..0000000 --- a/src/SbManager.IntegrationTests/app.config +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SbManager.IntegrationTests/packages.config b/src/SbManager.IntegrationTests/packages.config deleted file mode 100644 index 1daa6dc..0000000 --- a/src/SbManager.IntegrationTests/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/SbManager.Tests/App.config b/src/SbManager.Tests/App.config deleted file mode 100644 index 787d521..0000000 --- a/src/SbManager.Tests/App.config +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SbManager.Tests/Properties/AssemblyInfo.cs b/src/SbManager.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 3b2833d..0000000 --- a/src/SbManager.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SbManager.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("GlobalX")] -[assembly: AssemblyProduct("SbManager.Tests")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e58dfbff-3480-4e02-b6c5-52f4d5a3f76a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - diff --git a/src/SbManager.Tests/SbManager.Tests.csproj b/src/SbManager.Tests/SbManager.Tests.csproj index 4619a13..527cbf2 100644 --- a/src/SbManager.Tests/SbManager.Tests.csproj +++ b/src/SbManager.Tests/SbManager.Tests.csproj @@ -1,132 +1,19 @@ - - - + - Debug - AnyCPU - {4A7EB6CC-5996-46AB-872E-E000E78924B2} - Library - Properties - SbManager.Tests - SbManager.Tests - v4.6.1 - 512 - ..\ - true - + net461 + 1.0.0.0 + GlobalX - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll - False - - - ..\packages\CsQuery.1.3.4\lib\net40\CsQuery.dll - - - ..\packages\Microsoft.Azure.ServiceBus.3.0.1.16\lib\netstandard2.0\Microsoft.Azure.ServiceBus.dll - - - ..\packages\Nancy.1.4.3\lib\net40\Nancy.dll - True - - - ..\packages\Nancy.Serialization.JsonNet.1.4.1\lib\net40\Nancy.Serialization.JsonNet.dll - True - - - ..\packages\Nancy.Testing.1.4.1\lib\net40\Nancy.Testing.dll - True - - - ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll - True - - - ..\packages\NSubstitute.1.10.0.0\lib\net45\NSubstitute.dll - True - - - False - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - ..\packages\Serilog.2.0.0\lib\net45\Serilog.dll - True - - - ..\packages\Shouldly.2.8.0\lib\net40\Shouldly.dll - True - - - - - - - - - - - - - - False - ..\packages\TestStack.BDDfy.4.1.2\lib\NET40\TestStack.BDDfy.dll - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - {c3357d9e-5195-401f-8322-213d3a8cb749} - SbManager - + - - - \ No newline at end of file diff --git a/src/SbManager.Tests/packages.config b/src/SbManager.Tests/packages.config deleted file mode 100644 index c5fcc67..0000000 --- a/src/SbManager.Tests/packages.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SbManager/App.config b/src/SbManager/App.config index c6e25d9..306db17 100644 --- a/src/SbManager/App.config +++ b/src/SbManager/App.config @@ -15,46 +15,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SbManager/SbManager.csproj b/src/SbManager/SbManager.csproj index 83473a9..b95822b 100644 --- a/src/SbManager/SbManager.csproj +++ b/src/SbManager/SbManager.csproj @@ -1,501 +1,39 @@ - - - + - Debug - AnyCPU - {C3357D9E-5195-401F-8322-213D3A8CB749} Exe - Properties - SbManager - SbManager - v4.6.1 - 512 - true - ..\ - true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - 5 + false + net461 - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - - - - False - ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll - - - ..\packages\Humanizer.Core.2.1.0\lib\netstandard1.0\Humanizer.dll - True - - - ..\packages\Microsoft.Azure.Amqp.2.2.0\lib\net45\Microsoft.Azure.Amqp.dll - True - - - ..\packages\Microsoft.Azure.ServiceBus.3.0.1.16\lib\netstandard2.0\Microsoft.Azure.ServiceBus.dll - True - - - ..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.1\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll - True - - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.17.2\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll - True - - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.17.2\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll - True - - - ..\packages\Microsoft.IdentityModel.Logging.5.2.2\lib\net451\Microsoft.IdentityModel.Logging.dll - True - - - ..\packages\Microsoft.IdentityModel.Tokens.5.2.2\lib\net451\Microsoft.IdentityModel.Tokens.dll - True - - - False - ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll - - - False - ..\packages\Microsoft.Owin.Cors.3.0.1\lib\net45\Microsoft.Owin.Cors.dll - - - False - ..\packages\Microsoft.Owin.Diagnostics.3.0.1\lib\net45\Microsoft.Owin.Diagnostics.dll - - - False - ..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll - - - False - ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll - - - False - ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll - - - False - ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll - - - False - ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll - - - ..\packages\Mossharbor.AzureWorkArounds.ServiceBus.1.0.18\lib\net46\Mossharbor.AzureWorkArounds.ServiceBus.dll - True - - - - ..\packages\Nancy.1.4.3\lib\net40\Nancy.dll - True - - - ..\packages\Nancy.Bootstrappers.Autofac.1.4.1\lib\net40\Nancy.Bootstrappers.Autofac.dll - True - - - ..\packages\Nancy.Owin.1.4.1\lib\net40\Nancy.Owin.dll - True - - - ..\packages\Nancy.Serialization.JsonNet.1.4.1\lib\net40\Nancy.Serialization.JsonNet.dll - True - - - ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll - True - - - ..\packages\Owin.1.0\lib\net40\Owin.dll - - - ..\packages\Serilog.2.5.0\lib\net46\Serilog.dll - True - - - ..\packages\Serilog.Enrichers.Thread.2.0.0\lib\net45\Serilog.Enrichers.Thread.dll - True - - - ..\packages\Serilog.Sinks.Console.3.1.1\lib\net45\Serilog.Sinks.Console.dll - True - - - ..\packages\Serilog.Sinks.File.2.0.0\lib\net45\Serilog.Sinks.File.dll - True - - - ..\packages\Serilog.Sinks.RollingFile.2.1.0\lib\net45\Serilog.Sinks.RollingFile.dll - True - - - - - - - - ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - True - - - ..\packages\System.IdentityModel.Tokens.Jwt.5.2.2\lib\net451\System.IdentityModel.Tokens.Jwt.dll - True - - - ..\packages\System.IO.4.1.0\lib\net462\System.IO.dll - True - - - ..\packages\System.Net.WebSockets.4.0.0\lib\net46\System.Net.WebSockets.dll - True - - - ..\packages\System.Net.WebSockets.Client.4.0.0\lib\net46\System.Net.WebSockets.Client.dll - True - - - ..\packages\System.Runtime.4.1.0\lib\net462\System.Runtime.dll - True - - - - ..\packages\System.Runtime.Serialization.Primitives.4.3.0\lib\net46\System.Runtime.Serialization.Primitives.dll - True - - - ..\packages\System.Runtime.Serialization.Xml.4.3.0\lib\net46\System.Runtime.Serialization.Xml.dll - True - - - ..\packages\System.Security.Cryptography.Algorithms.4.2.0\lib\net463\System.Security.Cryptography.Algorithms.dll - True - - - ..\packages\System.Security.Cryptography.Encoding.4.0.0\lib\net46\System.Security.Cryptography.Encoding.dll - True - - - ..\packages\System.Security.Cryptography.Primitives.4.0.0\lib\net46\System.Security.Cryptography.Primitives.dll - True - - - ..\packages\System.Security.Cryptography.X509Certificates.4.1.0\lib\net461\System.Security.Cryptography.X509Certificates.dll - True - - - - - False - ..\packages\Microsoft.AspNet.Cors.5.2.3\lib\net45\System.Web.Cors.dll - - - - - - - - - - ..\packages\Topshelf.3.3.1\lib\net40-full\Topshelf.dll - True - - - ..\packages\Topshelf.Autofac.1.0.0\lib\net40\Topshelf.Autofac.dll - True - - - ..\packages\Topshelf.Serilog.3.3.1\lib\net40-full\Topshelf.Serilog.dll - True - - - - - GlobalAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - PreserveNewest - - - PreserveNewest - - - Always - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - - - PreserveNewest - - - PreserveNewest - - - Always - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - - - - PreserveNewest - - - PreserveNewest - + + + + + + + + + + + + + + + + + + + + + + + + - - - False - Microsoft .NET Framework 4.5.1 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - + + + + - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - \ No newline at end of file