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
AvailabilityChangeEvent does not carry generic information #21898
Comments
I was under the impression that |
Sure. This a simple sample application |
Thanks for the detailed report and the sample app. I've tracked this down and things should work as expected with the next release. In the meantime, I'm afraid you'll have to use your workaround. |
hello,i see this problem to understand the source code,try this without changing the source code,I hope that will be helpful.
|
@lifejwang11 Definitely helpful. Thanks. |
@alimate the fix is scheduled for 2.3.2 |
Synopsis
I was experimenting with the new Kubernetes probes support in Spring Actuator. The official documentation suggests that we can listen to changes in readiness or liveness by registering a bean like the following:
However, running an application with a bean like this fails with:
Details
This failure makes sense because during the application startup, Spring Boot fires both
AvailabilityChangeEvent<ReadinessState>
andAvailabilityChangeEvent<LivenessState>
events.Due to erasure, both of those events would e handled by the
ReadinessStateExporter
. Quite reasonably, theLivenessState
change event should fail because we can't castLivenessState
toReadinessState
.Hence the error:
I guess we probably should change the documentation as the sample code makes the Spring App to fail at startup.
Also, we could listen to
AvailabilityState
:Please kindly let me know what you think of this.
Cheers!
The text was updated successfully, but these errors were encountered: