When configuring an application to use a dedicated port for the management endpoints:
management.server.port: 8081
the health endpoint reports "UP" without waiting for the main application port to be exposed. This does not happen when both actuator and application are using the same port, which causes an undesired asymmetry.
This problem can be reproduced easily by having a SmartLifeCycle bean that will be registered to the main application context as is the case when using Spring Cloud Stream with a binding configured (i.e. with Kafka), the InputBindingLifecycle/OutputBindingLifecycle in default configuration will retry for a number of times before failing. During this period, the application has been reported as healthy.
Shouldn't there be an out of the box mechanism for the actuator health endpoint to be aware that the main application port is not yet exposed?
Reproduced with spring boot version: 2.0.3.