diff --git a/CHANGELOG.md b/CHANGELOG.md index 8eadeb6..35960f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to the AxonFlow Java SDK will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- **README "Retry Configuration" section.** Removed three `RetryConfig.Builder` + methods that do not exist on the public API (`initialDelayMs(int)`, + `maxDelayMs(int)`, `retryableStatusCodes(Set)`). The example now + uses the actual `initialDelay(Duration)` / `maxDelay(Duration)` builders, and + the surrounding prose documents the real retry contract from + `RetryExecutor.isRetryable`: retries fire on connect/timeout, `5xx`, and + `429`; `401`/`403` and other `4xx` are always terminal. Locked in by the + regression test added for + [getaxonflow/axonflow-enterprise#2275](https://github.com/getaxonflow/axonflow-enterprise/issues/2275) + in PR #178. Documentation-only — no code or behavior change. + ## [8.1.0] - 2026-05-19 — `X-Client-ID` header on every outbound request (v9 identity) **Companion release to the v9 identity cleanup on the platform (Epic #2230).** diff --git a/README.md b/README.md index 0a0a6d5..10ce5a5 100644 --- a/README.md +++ b/README.md @@ -337,19 +337,35 @@ try { ## Retry Configuration -The SDK includes automatic retry with exponential backoff: +The SDK includes automatic retry with exponential backoff. The retry policy +itself is not configurable per HTTP status — retries fire on connect/timeout +errors, `5xx` server errors, and `429 Too Many Requests`. Authentication +failures (`401`/`403`), policy violations, and other `4xx` client errors are +always terminal and never retried (see `RetryExecutor.isRetryable`). This +contract is locked in as a regression test for +[getaxonflow/axonflow-enterprise#2275](https://github.com/getaxonflow/axonflow-enterprise/issues/2275) +— a retry storm on `401` against a misconfigured agent. + +The `RetryConfig.Builder` exposes the following knobs: + +- `enabled(boolean)` — turn retries off entirely (defaults to `true`). +- `maxAttempts(int)` — total attempts including the first, `1`–`10` (default `3`). +- `initialDelay(Duration)` — base delay before the second attempt (default `1s`). +- `maxDelay(Duration)` — cap on the exponential backoff (default `30s`). +- `multiplier(double)` — backoff multiplier, ≥ `1.0` (default `2.0`). ```java +import java.time.Duration; + AxonFlowConfig config = AxonFlowConfig.builder() .endpoint("https://agent.getaxonflow.com") .clientId("your-client-id") - .clientSecret("your-client-secret") + .clientSecret("your-client-secret") .retryConfig(RetryConfig.builder() .maxAttempts(3) - .initialDelayMs(100) - .maxDelayMs(5000) + .initialDelay(Duration.ofMillis(100)) + .maxDelay(Duration.ofSeconds(5)) .multiplier(2.0) - .retryableStatusCodes(Set.of(429, 500, 502, 503, 504)) .build()) .build(); ```