All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.otto.edison.health.configuration.HealthConfiguration Maven / Gradle / Ivy

There is a newer version: 3.3.3
Show newest version
package de.otto.edison.health.configuration;

import de.otto.edison.health.indicator.ApplicationHealthIndicator;
import de.otto.edison.health.indicator.GracefulShutdownHealthIndicator;
import de.otto.edison.health.indicator.GracefulShutdownProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(GracefulShutdownProperties.class)
public class HealthConfiguration {

    @Bean
    @ConditionalOnProperty(prefix = "edison.gracefulshutdown", name = "enabled", havingValue = "true")
    public GracefulShutdownHealthIndicator gracefulShutdownHealthIndicator(final GracefulShutdownProperties properties) {
        return new GracefulShutdownHealthIndicator(properties);
    }

    @Bean
    public ApplicationHealthIndicator applicationHealthIndicator() {
        return new ApplicationHealthIndicator();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy