Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reactive Resilience4jBulkheadProvider to provide bulkhead support for reactive operations (Mono and Flux). #231

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yavor300
Copy link

Add support for reactive Resilience4jBulkheadProvider

  • Introduced ReactiveResilience4jBulkheadProvider to provide bulkhead support for reactive operations (Mono and Flux).
  • The provider decorates reactive streams (Mono and Flux) with a SemaphoreBulkhead to enforce concurrency limits.
  • Integrated ReactiveResilience4jBulkheadProvider into the run methods for Mono and Flux to handle bulkhead constraints, along with optional CircuitBreaker and TimeLimiter configurations.
  • Usage in the run methods:
    • For Mono<T>:
      1. The bulkheadProvider.decorateMono method decorates the Mono with bulkhead protection.
      2. The decorated Mono is then transformed with CircuitBreaker logic (CircuitBreakerOperator).
      3. If a TimeLimiter is configured, a timeout is applied, and any timeout error is reported to the CircuitBreaker.
      4. A fallback is applied to handle errors gracefully.
    • For Flux<T>:
      1. Similar decoration and transformations are applied for bulkhead, CircuitBreaker, and TimeLimiter.
      2. Fallback logic ensures graceful degradation for errors.
  • Ensured that only SemaphoreBulkhead is used for reactive scenarios since FixedThreadPoolBulkhead is not supported.
  • Updated configuration and tests to validate the behavior and integration of the provider in reactive streams.

This MR addresses issues #166 and #105 by introducing ReactiveResilience4jBulkheadProvider for handling bulkhead constraints in reactive streams.
Refs #166, #105

…head support for reactive operations (Mono and Flux).
…head support for reactive operations (Mono and Flux).
@yavor300
Copy link
Author

Closes #166, #105

…head support for reactive operations (Mono and Flux).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants