Skip to main content

Simpler configuration in ServiceControl

The Particular Service Platform is packed full of features that help you monitor your NServiceBus systems. Among other things, it enables you to:

  • manage messages that require a manual retry
  • see when endpoints go offline and back online
  • detect connectivity problems with databases, brokers, and other systems using custom checks
  • troubleshoot message processing performance, both per-message and across an entire flow, using ServiceInsight

Many of these capabilities have been developed over time as separate plugin packages. Each one has brought its own code-first configuration API. This approach has led to a situation where getting the most from the platform means installing six different NuGet packages and calling seven different configuration APIs.

We knew we could make it easier. What if it was just one package, and one configuration API?

🔗One package, one API

The new NServiceBus.ServicePlatform.Connector package simplifies connecting an NServiceBus endpoint to the Particular Service Platform by putting all of the configuration details into an easily serialized set of classes. It also includes a simple API to apply those configuration details to an endpoint.

var json = File.ReadAllText(pathToConfiguration);
var platformConnection = ServicePlatformConnectionDetails.Parse(json);
endpointConfiguration.ConnectToServicePlatform(platformConnection);

The configuration file is in JSON format:

{
  "ErrorQueue": "error",
  "MessageAudit": {
    "Enabled": true,
    "AuditQueue": "audit"
  },
  "SagaAudit": {
    "Enabled": true,
    "SagaAuditQueue": "audit"
  },
  "Heartbeats": {
    "Enabled": true,
    "HeartbeatsQueue": "Particular.ServiceControl",
    "Frequency": "00:00:30"
  },
  "CustomChecks": {
    "Enabled": true,
    "CustomChecksQueue": "Particular.ServiceControl"
  },
  "Metrics": {
    "Enabled": true,
    "MetricsQueue": "Particular.Monitoring",
    "Interval": "00:00:05",
    "InstanceId": "MyEndpointUniqueInstanceId"
  }
}

With this file in place, you can enable and disable features and adjust configuration at deployment time in each environment.

“But that’s just moving the complexity to a file,” you astutely point out. If you have to hand-craft the file then we haven’t really simplified anything. We thought of that too.

With the latest versions of ServiceControl and ServicePulse, you can view the JSON configuration directly in ServicePulse.

ServicePulse connection details

You don’t have to store the configuration in a file, or even as JSON. You can integrate with anything that can handle strongly-typed configuration. Here’s a sample showing how to retrieve ServicePlatform Configuration from Microsoft.Extensions.Configuration.

🔗Summary

Centralized configuration makes things much easier for anyone who is managing a distributed system. With the NServiceBus.ServicePlatform.Connector we’ve greatly simplified this process for ServiceControl and we think you’ll agree it’s a better experience.

Get the latest versions of ServiceControl and ServicePulse here:

Share on Twitter

About the authors

Christian Quirós

Christian Quirós is a software developer at Particular Software who is constantly looking for ways in which he can remove complexity in our code and our processes.

Dan Kent

Dan Kent is a developer at Particular Software who is always on the lookout for keeping things simple.

Mike Minutillo

Mike is a developer at Particular who appreciates when things are simple.

Tomek Masternak

Tomek is a dev who likes it simple.

Don't miss a thing. Sign up today and we'll send you an email when new posts come out.
Thank you for subscribing. We'll be in touch soon.
 
We collect and use this information in accordance with our privacy policy.