-
Notifications
You must be signed in to change notification settings - Fork 40.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ApplicationAvailability bean is auto-configured even if a custom one is already present #34347
ApplicationAvailability bean is auto-configured even if a custom one is already present #34347
Conversation
198b63a
to
0daf6cc
Compare
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.boot.autoconfigure.availability; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also i moved package from kubernetes to availability since it seems to make sense.
0daf6cc
to
b1ac4c3
Compare
Signed-off-by: Taeik Lim <sibera21@gmail.com>
b1ac4c3
to
6af8882
Compare
Thanks, @acktsap. Given that we have the |
@acktsap thank you for making your first contribution to Spring Boot. |
Hi All ApplicationAvailabilityBean is not being peaked up by DefaultListableBeanFactory typeToMatch.isAssignableFrom(beanType) where typeToMatch - ApplicationListener, beanType - ApplicationAvailability in 2.7.10 it was and all worked well. and as a result it's missed during publishing event in org.springframework.boot.context.event.EventPublishingRunListener#started please check this. |
@dyakovni That has been fixed by #35161. |
Spring boot actuator autoconfigures
ApplicationAvailability
bean which is used in AvailabilityProbesAutoConfiguration and AvailabilityHealthContributorAutoConfiguration.That is awesome since it automatically configures kubernetes probes in separate endpoints (liveness, readiness).
But if i want to replace
ApplicationAvailability
bean injected inLivenessStateHealthIndicator
andReadinessStateHealthIndicator
i have to registerApplicationAvailability
as@Primary
since it's always registered by ApplicationAvailabilityAutoConfiguration.This PR prevents auto-registeration of
ApplicationAvailability
bean when it's already present.