To install the Heartbeats plugin into an endpoint, reference the NServiceBus.Heartbeat NuGet package and add the following to the endpoint configuration:
var endpointConfiguration = new EndpointConfiguration("MyEndpoint"); endpointConfiguration.SendHeartbeatTo( serviceControlQueue: "ServiceControl_Queue", frequency: TimeSpan.FromSeconds(15), timeToLive: TimeSpan.FromSeconds(30));
ServiceControl_Queueis a placeholder for the actual ServiceControl input queue. The ServiceControl input queue is equal to the ServiceControl service name as configured in the ServiceControl Management tool.
Heartbeat messages are sent by the plugin at a predefined interval of 10 seconds. As shown above, the interval value can be overridden on a per-endpoint basis.
HeartbeatGracePeriodis greater than the heartbeat interval.
When the plugin sends heartbeat messages, the default TTL is fixed to four times the value of the heartbeat interval. As shown above, the interval value can be overridden on a per-endpoint basis. See Expired heartbeats for more information about what happens to expired heartbeats.
When installing the heartbeat plugin on a scaled-out endpoint, also configure each instance with a deterministic Host Identifier. This identifier is used to keep track of which instance is sending heartbeat messages to the ServiceControl instance.