Spring Boot 4 Actuator in production: endpoints, security, custom health indicators
Companion repository for the ankurm.com article. Every transcript in docs/output/ was produced by running this project; scripts/run-all.sh regenerates all of them. Verified against Spring Boot 4.1.1 / Framework 7.0.9 / Security 7.1.1 / Micrometer 1.17.1 / kafka-clients 4.2.1 on Temurin JDK 25.0.4.1+1.
This commit is contained in:
18
docs/output/10-slow-upstream.txt
Normal file
18
docs/output/10-slow-upstream.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
### profile: details upstream deliberately sleeping 30s per request
|
||||
### demo.upstream.timeout-ms = 750, so the indicator gives up long before the stub replies
|
||||
|
||||
$ time curl -s http://localhost:8080/actuator/health/externalApi
|
||||
{
|
||||
"details": {
|
||||
"error": "org.springframework.web.client.ResourceAccessException: I/O error on GET request for \"http://localhost:8080/stub/upstream/ping\": Read timed out",
|
||||
"url": "http://localhost:8080/stub/upstream/ping",
|
||||
"latencyMs": 753,
|
||||
"timeoutMs": 750
|
||||
},
|
||||
"status": "DOWN"
|
||||
}
|
||||
wall clock: 0.84 s
|
||||
|
||||
The read timeout is what bounds this, not the endpoint. Remove setReadTimeout from
|
||||
ExternalApiHealthIndicator and this call blocks for the full 30 seconds, holding a
|
||||
Tomcat worker the whole time.
|
||||
Reference in New Issue
Block a user