Files
asmhatreandClaude Opus 5 7e1676c763 Add resilience: Spring Framework 7 @Retryable and @ConcurrencyLimit
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
2026-09-11 17:12:25 +00:00

28 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# Which attributes exist in which 7.0.x release, read by reflection from the jars themselves.
# Needs spring-context/spring-core 7.0.0-7.0.3 in the local repository, e.g.
# mvn dependency:get -Dartifact=org.springframework:spring-context:7.0.0 (and 7.0.1, 7.0.2, 7.0.3,
# plus the matching spring-core)
# -> docs/output/api-surface.txt
set -uo pipefail
source "$(dirname "$0")/env.sh"
M2="${M2:-$HOME/.m2/repository}"
S="$M2/org/springframework"
cat > /tmp/api-surface.jsh <<'JSH'
String attrs(Class<?> c) { var s = new java.util.TreeSet<String>(); for (var m : c.getDeclaredMethods()) if (java.lang.reflect.Modifier.isPublic(m.getModifiers())) s.add(m.getName()); return s.toString(); }
System.out.println(" @Retryable " + attrs(org.springframework.resilience.annotation.Retryable.class));
System.out.println(" @ConcurrencyLimit " + attrs(org.springframework.resilience.annotation.ConcurrencyLimit.class));
System.out.println(" RetryPolicy.Builder " + attrs(org.springframework.core.retry.RetryPolicy.Builder.class));
System.out.println(" RetryListener " + attrs(org.springframework.core.retry.RetryListener.class));
/exit
JSH
{
echo "# Public API of the resilience support, per Spring Framework release"
for v in 7.0.0 7.0.1 7.0.2 7.0.3 7.0.9; do
echo; echo "## $v"
CP="$S/spring-context/$v/spring-context-$v.jar:$S/spring-core/$v/spring-core-$v.jar:$S/spring-aop/7.0.9/spring-aop-7.0.9.jar:$S/spring-beans/7.0.9/spring-beans-7.0.9.jar:$(ls "$M2"/org/jspecify/jspecify/*/jspecify-*.jar | head -1)"
jshell --class-path "$CP" -q /tmp/api-surface.jsh 2>&1 | grep -v 'Picked up' | sed 's/^jshell> //'
done
} > "$OUT/api-surface.txt"
cat "$OUT/api-surface.txt"