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
Setting health endpoint cache time-to-live does not actually use CachingOperationInvoker #18959
Comments
Hi @temesoft . I think I'm on to something. Not a team member, but give me until this morning to try out my idea. |
So here's what I found so far. The problem comes from the fact that This was likely introduced with #17929. |
Thank you both. We'll have a look to handle |
Prior to this commit, ApiVersion was treated as a mandatory parameter in CachingOperationInvokerAdvisor and thus prevented the CachingOperationInvoker to kick in. By skipping ApiVersion in the same way we're skipping SecurityContext we can avoid this. In order to not return the same cached response, this commit also changes the cache handling in CachingOperationInvoker to account for different ApiVersions being passed. Closes spring-projectsgh-18959
Made a proposal fix in #18961 |
Closing in favour or PR #18961 |
When setting
management.endpoint.health.cache.time-to-live=60s
configuration to specify caching of health endpoint response - it seems not to take an effect in 2.2.0 release version. When requesting health endpointReflectiveOperationInvoker
is being called instead ofCachingOperationInvoker
.Attached, is a sample spring-boot application with a JUnit test that shows this issue.
my-app.zip
P.S. When switching to use an older version (for example 2.0.3) the health endpoint response is cached correctly.
Thank you
-Dmitriy
The text was updated successfully, but these errors were encountered: