Skip to content

feat: expose slowCallDurationThreshold in CircuitBreakerConfiguration#1153

Open
dira-AUR wants to merge 3 commits intoSAP:mainfrom
dira-AUR:feature/cb-slow-call-threshold
Open

feat: expose slowCallDurationThreshold in CircuitBreakerConfiguration#1153
dira-AUR wants to merge 3 commits intoSAP:mainfrom
dira-AUR:feature/cb-slow-call-threshold

Conversation

@dira-AUR
Copy link
Copy Markdown

@dira-AUR dira-AUR commented Apr 20, 2026

Summary

Exposes the slowCallDurationThreshold and slowCallRateThreshold properties from resilience4j's CircuitBreakerConfig in the SAP Cloud SDK's ResilienceConfiguration.CircuitBreakerConfiguration wrapper.

Motivation

Currently, users who need to configure slow-call detection for their circuit breakers must resort to reflection to access the underlying resilience4j configuration, which is fragile and not officially supported.
The resilience4j CircuitBreakerConfig supports:

  • slowCallDurationThreshold — duration above which a call is considered slow
  • slowCallRateThreshold — percentage of slow calls that triggers the circuit breaker to open
    These are common production requirements, especially when integrating with external systems (e.g., SAP OData services) that may degrade gradually rather than fail outright.

Changes

…reshold in CircuitBreakerConfiguration

Add two new optional properties to CircuitBreakerConfiguration:
- slowCallDurationThreshold (default: 60s, matching Resilience4j default)
- slowCallRateThreshold (default: 100%, matching Resilience4j default)

Wire both properties through DefaultCircuitBreakerProvider into the
Resilience4j CircuitBreakerConfig builder.

This is fully backwards-compatible as the defaults match Resilience4j's
existing defaults.

Resolves SAP#1148

Signed-off-by: dira-AUR <243805326+dira-AUR@users.noreply.github.com>
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Apr 20, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@newtork newtork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Please format javadoc and add @since tag
dira-AUR/cloud-sdk-java@main...newtork:patch-1 (after pulling and merging latest changes from main)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose slowCallDurationThreshold and slowCallRateThreshold in CircuitBreakerConfiguration

2 participants