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_Queueis a placeholder for the name of the ServiceControl input queue. The name of the ServiceControl input queue matches the ServiceControl service name configured in the ServiceControl Management application.
The plugin sends heartbeat messages with a default frequency of 10 seconds. As shown above, the frequency may be overridden for each endpoint.
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.