use of io.micronaut.health.HeartbeatEvent in project micronaut-core by micronaut-projects.
the class AutoRegistration method onApplicationEvent.
@Override
public void onApplicationEvent(AbstractServiceInstanceEvent event) {
if (registrationConfiguration.isEnabled()) {
if (event instanceof ServiceReadyEvent) {
register(event.getSource());
} else if (event instanceof ServiceStoppedEvent) {
if (registrationConfiguration.isDeregister()) {
deregister(event.getSource());
}
} else if (event instanceof HeartbeatEvent) {
HeartbeatEvent heartbeatEvent = (HeartbeatEvent) event;
pulsate(event.getSource(), heartbeatEvent.getStatus());
}
}
}
Aggregations