Skip to content

Renewal via enabler ignore health of application #1401

Open
@pj892031

Description

@pj892031

Describe the bug
Java enabler and spring enabler renew state in DS always as UP, although the real state is different.

Steps to Reproduce

  1. create a service
  2. define your own health indicator
    @component
    @requiredargsconstructor
    public class MyHealthIndicator extends AbstractHealthIndicator {
    @OverRide
    protected void doHealthCheck(Health.Builder builder) {
    builder.down();
    }
    }

/actuator/health returns status DOWN
APIML has status UP

Expected behavior
The service has status down in the APIML

Additional context
Java enabler can implement HealtCheck based on local REST call because configuration should contain property statusPageRelativeUrl.

Spring enabler can fetch all beans to calculate state, like:

private final ApplicationContext applicationContext;

@Override
public void register(ApiMediationServiceConfig config, Ssl ssl) {
    super.register(config, ssl);
    ApiMediationClient apiMediationClient = super.getApiMediationClient();
    if (apiMediationClient.getEurekaClient() != null) {
        registerHealthIndicators(apiMediationClient.getEurekaClient());
    }
}

... or use the same mechanism via REST call, fetching of beans can be more useful (independent of network)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status

      Unplanned Bugs

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions