Skip to content

Instantly share code, notes, and snippets.

@spericas
Last active June 2, 2022 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spericas/297988508f8f2b942fee2b0c5eaa2b6b to your computer and use it in GitHub Desktop.
Save spericas/297988508f8f2b942fee2b0c5eaa2b6b to your computer and use it in GitHub Desktop.
FT SE Configuration

Basic configuration for SE FT commands. No configuration support for Async or Fallback.

What should be configurable:

  • Bulkhead:
    • limit (int)
    • queue-length (int)
    • name (string)
    • cancel-source (boolean)
  • Circuit breaker:
    • delay (duration)
    • error-ratio (int)
    • success-threshold (int)
    • volume (int)
    • name (string)
    • cancel-source (boolean)
  • Retry:
    • name (string)
    • overall-timeout (duration)
    • delaying-retry-policy:
      • calls (int)
      • delay-millis (long)
      • delay-factor (double)
    • jitter-retry-policy
      • calls (int)
      • delay-millis (long)
      • jitter (long)
  • Timeout:
    • timeout (duration)
    • current-thread (boolean)
    • name (string)
    • cancel-source (boolean)

Examples

Config config = getConfig();
Bulkhead bulkhead = Bulkhead.builder()
                            .config(config.get("bulknhead"))
                            .build();
--

bulkhead:
    limit: 10
    queue-length: 20
    name: "MyBulkhead"
    cancel-source: true
Config config = getConfig();
CircuitBreaker breaker = CircuitBreaker.builder()
                                       .config(config.get("circuitbreaker"))
                                       .value(5)    // overrides
                                       .build();

--

circuitbreaker:
    delay: "PT2S"
    volume: 20
    name: "MyCircuitBreaker"
Config config = getConfig();
Retry retry = Retry.builder()
                   .config(config.get("retry"))    // will configure any retry policy too
                   .build();
--

retry:
    overall-timeout: "PT10S"
    delay-retry-policy:
         calls: 5
         delay-millis: 2000
         delay-factor: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment