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.
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: