Keep an Eye On Your Azure Service Bus with the Particular Platform
You might have a good idea about how you’d implement an architecture that utilizes a service bus with asynchronous messaging, but how do you manage the application once it’s live?
By implementing a service bus and moving toward a more domain-driven design, you’ve broken up the application into loosely coupled services. You’ve also introduced some operational complexity in monitoring and keeping all these moving pieces in your head. You might be worried about lack of visibility, which is important when you’ve cracked open the hood of a monolith or are building a distributed system.
Particular Platform
To ease your worries I suggest The Particular Service Platform. If you haven’t already, download the Particular Platform Installer here and install ServiceControl, ServicePulse, and ServiceInsight.
The beauty of the tooling around NServiceBus is the multitude of supported transports, including: MSMQ, RabbitMQ, Azure Service Bus, Azure Storage Queues, and SQL Server. You can gain situational awareness of your system regardless of which transport you choose.
Configure ServiceControl
ServiceControl is the core backend service (installed as a Windows Service) that collects data from your NServiceBus endpoints. It then pushes this data to the ServicePulse and ServiceInsight applications.
Let’s configure ServiceControl to monitor an Azure Service Bus transport (check out previous post about setting up a sample NServiceBus project over Azure Service Bus)
The first thing we need to do is stop the ServiceControl. Open up a Powershell or CMD prompt and run:
> net stop Particular.ServiceControl
Next, uninstall the Particular.ServiceControl service by navigating to the ServiceControl install location and running the ServiceControl.exe --uninstall
command:
> cd "C:\Program Files (x86)\Particular Software\ServiceControl"
> .\ServiceControl.exe --uninstall
Following the instructions in the ServiceControl > Configuration > Multi Transport Support section in the docs, get the ServiceControl installation command-line arguments for Azure Service Bus. Replace the bold area below with your Azure Service Bus namespace connection string:
> .\ServiceControl.exe --install -serviceName="Particular.ServiceControl" -displayName="Particular ServiceControl" -d="ServiceControl/TransportType==NServiceBus.AzureServiceBus, NServiceBus.Azure.Transports.WindowsAzureServiceBus" -d="NServiceBus/Transport==Endpoint=sb://[endpoint-name].servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=[your-shared-secret]"
Once you run the command and ServiceControl is reinstalled, run:
net start Particular.ServiceControl
Add NuGet Packages to your Endpoints
The final piece to allowing the ServiceInsight and ServicePulse tools to monitor your NServiceBus endpoints is to add the ServiceControl Endpoint Plugins NuGet packages to your project. Install the following NuGet packages for all of the projects you want to monitor:
> Install-Package ServiceControl.Plugin.Nsb5.Hearbeat
> Install-Package ServiceControl.Plugin.Nsb5.CustomChecks
> Install-Package ServiceControl.Plugin.Nsb5.SagaAudit
> Install-Package ServiceControl.Plugin.Nsb5.DebugSession
ServicePulse
If everything was configured correctly, you should be able to go to http://localhost:9090/ and view the ServicePulse UI. It tells you about the status of your endpoints and failed messages, as well as custom endpoint monitoring defined with the CustomChecks plugin:
ServiceInsight
You should also be able to open ServiceInsight and connect it to your ServiceControl service at http://locahost:33333/api/. It gives you detailed views of your system including message flow, message body properties, and saga information:
Summary
Hopefully this eases your worries about keeping all of these moving parts in your head by getting them OUT of your head and into some valuable monitoring tools for your distributed system built on Particular’s Platform.
Make sure you sign up for my newsletter to get my latest articles!