Companion code for "Spring Framework 7's Built-in Resilience: @Retryable, @ConcurrencyLimit, and What's Left for Resilience4j". Every retry counted by recording real invocations: defaults, backoff and jitter, timeout, reactive and CompletableFuture returns, the concurrency limit's BLOCK and REJECT policies, retries around transactions, composition with Resilience4j 2.4.0, and the annotation API across 7.0.0-7.0.9. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01C3TETMrqVUWeFkNtz3Jbo3
33 lines
1.5 KiB
Bash
33 lines
1.5 KiB
Bash
#!/usr/bin/env bash
|
|
# Regenerate every transcript under docs/output/. About a minute and a half - several scenarios
|
|
# sleep through Spring's one-second default delay on purpose.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
source scripts/env.sh
|
|
mvn -q -DskipTests package
|
|
./scripts/run.sh
|
|
./scripts/demo.sh retry defaults exhausted exponential jitter includes cause future mono timeout hang self-invocation
|
|
./scripts/demo.sh tx standalone joined
|
|
./scripts/demo.sh limit none block reject limit-and-retry r4j-bulkhead
|
|
./scripts/demo.sh r4j retry breaker combo timelimiter
|
|
./scripts/demo.sh proxy payments stock-writer reports gateway
|
|
{
|
|
echo "# Spring retry has no metrics of its own; the only meter is the one RetryEvents registers."
|
|
echo "\$ curl /actuator/metrics | grep -iE 'retry|resilience4j'"
|
|
curl -s "$BASE/actuator/metrics" | python3 -c 'import json,sys
|
|
print("\n".join(n for n in json.load(sys.stdin)["names"] if "retry" in n or "resilience4j" in n))'
|
|
} > "$OUT/metrics-names.txt"
|
|
./scripts/stop.sh
|
|
EXTRA_ARGS=--demo.resilience.enabled=false ./scripts/run.sh
|
|
{
|
|
echo "# The same @Retryable method with @EnableResilientMethods switched off (demo.resilience.enabled=false)"
|
|
echo
|
|
curl -s "$BASE/demo/retry/defaults" | python3 -m json.tool
|
|
echo
|
|
echo "# Startup log lines mentioning retry or resilience:"
|
|
grep -E 'Retr|Resilient|ConcurrencyLimit' "$LOG" | grep -v 'Picked up' || echo "(none)"
|
|
} > "$OUT/retry-disabled.txt"
|
|
./scripts/stop.sh
|
|
./scripts/demo-api-surface.sh
|
|
echo "Regenerated: $(ls docs/output | wc -l) files in docs/output/"
|