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:
19
scripts/demo-kafka-timeout.sh
Executable file
19
scripts/demo-kafka-timeout.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# The single most useful number in this repository: how long a naive Kafka health check blocks.
|
||||
set -uo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
OUT=docs/output/09-kafka-timeout.txt
|
||||
MODE="${1:-tuned}"
|
||||
B=http://localhost:8080/actuator/health/kafka
|
||||
{
|
||||
echo "### Kafka health check against an unreachable broker -- ${MODE}"
|
||||
echo
|
||||
echo "\$ time curl -s $B"
|
||||
s=$(date +%s.%N)
|
||||
body=$(curl -s -u ops:ops-password --max-time 180 "$B")
|
||||
e=$(date +%s.%N)
|
||||
echo "$body" | python3 -m json.tool 2>/dev/null || echo "$body"
|
||||
echo
|
||||
printf 'wall clock: %.1f s\n' "$(echo "$e - $s" | bc)"
|
||||
} > "$OUT.$MODE" 2>&1
|
||||
echo "wrote $OUT.$MODE"
|
||||
Reference in New Issue
Block a user