Skip to content

HealthIndicator does not return HTTP Status 503 for Status.DOWN #1264

@matsev

Description

@matsev

Currently HTTP status 200 is returned for Status.DOWN.

In the Spring Boot 1.1 release notes it is stated that:

By default Status.DOWN will create a 503; Status.UP will return 200.

Step by step:

  • Create a simple web app configured with the actuator.
  • Add a "down" health check:
@Component
public class DownHealthIndicator extends AbstractHealthIndicator {

    @Override
    protected void doHealthCheck(Health.Builder builder) throws Exception {
        builder.down();
    }
}
  • Check the health status:
$ curl -i localhost:8080/health
HTTP/1.1 200 OK
[...]
{"status":"DOWN"}

Spring Boot version: 1.1.4.RELEASE

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions