Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
# Changelog

## [Unreleased](https://github.com/openfga/java-sdk/compare/v0.8.3...HEAD)
## [Unreleased](https://github.com/openfga/java-sdk/compare/v0.9.0...HEAD)

## v0.9.0

### [0.9.0](https://github.com/openfga/java-sdk/compare/v0.8.3...v0.9.0) (2025-08-15)

### Added
- feat: RFC 9110 compliant Retry-After header support with exponential backoff and jitter
- feat: Enhanced retry strategy with delay calculation
- feat: Retry-After header value exposed in error objects for better observability
- feat: Input validation for Configuration.minimumRetryDelay() to prevent negative values
- feat: Default value (100ms) now explicitly set for minimumRetryDelay configuration
- RFC 9110 compliant `Retry-After` header support with exponential backoff and jitter
- `Retry-After` header value exposed in error objects for better observability
- `FgaError` now exposes `Retry-After` header value via `getRetryAfterHeader()` method

### Changed
- Enhanced retry strategy with delay calculation
- **BREAKING**: Maximum allowable retry count is now enforced at 15 (default remains 3)
- **BREAKING**: FgaError now exposes Retry-After header value via getRetryAfterHeader() method
- **BREAKING**: Configuration.minimumRetryDelay() now requires non-null values and validates input, throwing IllegalArgumentException for null or negative values

### Technical Details
- Implements RFC 9110 compliant Retry-After header parsing (supports both integer seconds and HTTP-date formats)
- Adds exponential backoff with jitter (base delay: 2^retryCount * 100ms, capped at 120 seconds)
- Validates Retry-After values between 1-1800 seconds (30 minutes maximum)
- Prioritizes Retry-After header delays over exponential backoff when present
- Unified retry behavior: All requests retry on 429s and 5xx errors (except 501 Not Implemented)

**Migration Guide**:
- Update error handling code if using FgaError properties - new getRetryAfterHeader() method available
- Note: Maximum allowable retries is now enforced at 15 (validation added to prevent exceeding this limit)
- **IMPORTANT**: Configuration.minimumRetryDelay() now requires non-null values and validates input - ensure you're not passing null or negative Duration values, as this will now throw IllegalArgumentException. Previously null values were silently accepted and would fall back to default behavior at runtime.

### Fixed
- Fixed issue where telemetry metrics are not being exported correctly [#590](https://github.com/openfga/sdk-generator/pull/590)
- Fixed issue with non-transactional write error handling [https://github.com/openfga/sdk-generator/pull/573](https://github.com/openfga/sdk-generator/pull/573)

## v0.8.3

### [0.8.3](https://github.com/openfga/java-sdk/compare/v0.8.2...v0.8.3) (2025-07-15)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ It can be used with the following:
* Gradle (Groovy)

```groovy
implementation 'dev.openfga:openfga-sdk:0.8.3'
implementation 'dev.openfga:openfga-sdk:0.9.0'
```

* Gradle (Kotlin)

```kotlin
implementation("dev.openfga:openfga-sdk:0.8.3")
implementation("dev.openfga:openfga-sdk:0.9.0")
```

* Apache Maven
Expand All @@ -94,26 +94,26 @@ implementation("dev.openfga:openfga-sdk:0.8.3")
<dependency>
<groupId>dev.openfga</groupId>
<artifactId>openfga-sdk</artifactId>
<version>0.8.3</version>
<version>0.9.0</version>
</dependency>
```

* Ivy

```xml
<dependency org="dev.openfga" name="openfga-sdk" rev="0.8.3"/>
<dependency org="dev.openfga" name="openfga-sdk" rev="0.9.0"/>
```

* SBT

```scala
libraryDependencies += "dev.openfga" % "openfga-sdk" % "0.8.3"
libraryDependencies += "dev.openfga" % "openfga-sdk" % "0.9.0"
```

* Leiningen

```edn
[dev.openfga/openfga-sdk "0.8.3"]
[dev.openfga/openfga-sdk "0.9.0"]
```


Expand Down Expand Up @@ -1001,7 +1001,7 @@ public class Example {
.storeId(System.getenv("FGA_STORE_ID")) // Not required when calling createStore() or listStores()
.authorizationModelId(System.getenv("FGA_MODEL_ID")) // Optional, can be overridden per request
.maxRetries(3) // retry up to 3 times on API requests (default: 3, maximum: 15)
.minimumRetryDelay(100); // minimum wait time between retries in milliseconds (default: 100ms)
.minimumRetryDelay(Duration.ofMillis(100)); // minimum wait time between retries in milliseconds (default: 100ms)

var fgaClient = new OpenFgaClient(config);
var response = fgaClient.readAuthorizationModels().get();
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
apply from: 'publish.gradle'

group = 'dev.openfga'
version = '0.8.3'
version = '0.9.0'

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion example/example1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ext {
}

dependencies {
implementation("dev.openfga:openfga-sdk:0.8.3")
implementation("dev.openfga:openfga-sdk:0.9.0")

// Serialization
implementation("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
Expand Down
2 changes: 1 addition & 1 deletion publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publishing {
pom {
group = 'dev.openfga'
name = 'openfga-sdk'
version = '0.8.3'
version = '0.9.0'
description = 'This is an autogenerated Java SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api).'
url = 'https://openfga.dev'
licenses {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
* Configurations for an api client.
*/
public class Configuration implements BaseConfiguration {
public static final String VERSION = "0.8.3";
public static final String VERSION = "0.9.0";

private static final String DEFAULT_API_URL = "http://localhost:8080";
private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.8.3";
private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.9.0";
private static final Duration DEFAULT_READ_TIMEOUT = Duration.ofSeconds(10);
private static final Duration DEFAULT_CONNECT_TIMEOUT = Duration.ofSeconds(10);
private static final int DEFAULT_MAX_RETRIES = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class ConfigurationTest {
private static final String DEFAULT_API_URL = "http://localhost:8080";
private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.8.3";
private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.9.0";
private static final Duration DEFAULT_READ_TIMEOUT = Duration.ofSeconds(10);
private static final Duration DEFAULT_CONNECT_TIMEOUT = Duration.ofSeconds(10);
private static final Map<String, String> DEFAULT_HEADERS = Map.of();
Expand Down
Loading