Search in sources :

Example 1 with AdditionalHealthEndpointPathsWebFluxHandlerMapping

use of org.springframework.boot.actuate.endpoint.web.reactive.AdditionalHealthEndpointPathsWebFluxHandlerMapping in project spring-boot by spring-projects.

the class WebFluxEndpointManagementContextConfiguration method managementHealthEndpointWebFluxHandlerMapping.

@Bean
@ConditionalOnManagementPort(ManagementPortType.DIFFERENT)
@ConditionalOnAvailableEndpoint(endpoint = HealthEndpoint.class, exposure = EndpointExposure.WEB)
@ConditionalOnBean(HealthEndpoint.class)
public AdditionalHealthEndpointPathsWebFluxHandlerMapping managementHealthEndpointWebFluxHandlerMapping(WebEndpointsSupplier webEndpointsSupplier, HealthEndpointGroups groups) {
    Collection<ExposableWebEndpoint> webEndpoints = webEndpointsSupplier.getEndpoints();
    ExposableWebEndpoint health = webEndpoints.stream().filter((endpoint) -> endpoint.getEndpointId().equals(HealthEndpoint.ID)).findFirst().get();
    return new AdditionalHealthEndpointPathsWebFluxHandlerMapping(new EndpointMapping(""), health, groups.getAllWithAdditionalPath(WebServerNamespace.MANAGEMENT));
}
Also used : ExposableWebEndpoint(org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint) EndpointMapping(org.springframework.boot.actuate.endpoint.web.EndpointMapping) AdditionalHealthEndpointPathsWebFluxHandlerMapping(org.springframework.boot.actuate.endpoint.web.reactive.AdditionalHealthEndpointPathsWebFluxHandlerMapping) ConditionalOnAvailableEndpoint(org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnManagementPort(org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ConditionalOnAvailableEndpoint (org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint)1 ConditionalOnManagementPort (org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort)1 EndpointMapping (org.springframework.boot.actuate.endpoint.web.EndpointMapping)1 ExposableWebEndpoint (org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint)1 AdditionalHealthEndpointPathsWebFluxHandlerMapping (org.springframework.boot.actuate.endpoint.web.reactive.AdditionalHealthEndpointPathsWebFluxHandlerMapping)1 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1