This plugin can be enabled and configured with the ServicePlatform Connector plugin.
To install the heartbeat plugin in an endpoint, reference the NServiceBus.Heartbeat NuGet package and configure the endpoint to send heartbeats:
var endpointConfiguration = new EndpointConfiguration("MyEndpoint");
endpointConfiguration.SendHeartbeatTo(
serviceControlQueue: "ServiceControl_Queue",
frequency: TimeSpan.FromSeconds(15),
timeToLive: TimeSpan.FromSeconds(30));
ServiceControl_Queue
is a placeholder for the name of the ServiceControl input queue. The name of the ServiceControl input queue matches the ServiceControl instance name configured in the ServiceControl Management application.
Heartbeat interval
The plugin sends heartbeat messages with a default frequency of 10 seconds. As shown above, the frequency may be overridden for each endpoint.
The frequency must be lower than the HeartbeatGracePeriod
in ServiceControl.
Time-To-Live (TTL)
The plugin sends heartbeat messages with a default TTL of four times the frequency. As shown above, the TTL may be overridden for each endpoint. See the documentation for expired heartbeats for more information.
Identifying scaled-out endpoints
When the heartbeat plugin is installed in a scaled-out endpoint, each endpoint instance must be configured with a unique host identifier. The identifiers are used by ServiceControl to keep track of all instances and to identify which instance sent a given heartbeat message.