@Test public void TestRetryBudgetRatioBeanValidation() { assertValidates(new BalancingHttpClientConfig().setRetryBudgetRatio(new BigDecimal(0))); assertFailsValidation(new BalancingHttpClientConfig().setRetryBudgetRatio(new BigDecimal(-1).movePointLeft(3)), "retryBudgetRatio", "must be greater than or equal to 0", Min.class); assertValidates(new BalancingHttpClientConfig().setRetryBudgetRatio(new BigDecimal(1000))); assertFailsValidation(new BalancingHttpClientConfig().setRetryBudgetRatio(new BigDecimal(10001).movePointLeft(1)), "retryBudgetRatio", "must be less than or equal to 1000", Max.class); }
@Config("http-client.retry-budget.ratio") @ConfigDescription("The ratio of permitted retries to initial requests") public BalancingHttpClientConfig setRetryBudgetRatio(BigDecimal retryBudgetRatio) { this.retryBudgetRatio = retryBudgetRatio; return this; }
BalancingHttpClientConfig { @Config("http-client.retry-budget.ratio") @ConfigDescription("The ratio of permitted retries to initial requests") public BalancingHttpClientConfig setRetryBudgetRatio(BigDecimal retryBudgetRatio) { this.retryBudgetRatio = retryBudgetRatio; return this; } }
BalancingHttpClientConfig { @Config("http-client.retry-budget.ratio") @ConfigDescription("The ratio of permitted retries to initial requests") public BalancingHttpClientConfig setRetryBudgetRatio(BigDecimal retryBudgetRatio) { this.retryBudgetRatio = retryBudgetRatio; return this; }  }
BalancingHttpClientConfig { @Config("http-client.retry-budget.ratio") @ConfigDescription("The ratio of permitted retries to initial requests") public BalancingHttpClientConfig setRetryBudgetRatio(BigDecimal retryBudgetRatio) { this.retryBudgetRatio = retryBudgetRatio; return this; }  @Min(1) int getMaxAttempts(); @Config("http-client.max-attempts") BalancingHttpClientConfig setMaxAttempts(int maxAttempts); Duration getMinBackoff(); @Config("http-client.min-backoff") @ConfigDescription("Minimum backoff delay before a retry") BalancingHttpClientConfig setMinBackoff(Duration minBackoff); Duration getMaxBackoff(); @Config("http-client.max-backoff") @ConfigDescription("Maximum backoff delay before a retry") BalancingHttpClientConfig setMaxBackoff(Duration maxBackoff); @Min(0) @Max(1000) BigDecimal getRetryBudgetRatio(); @Config("http-client.retry-budget.ratio") @ConfigDescription("The ratio of permitted retries to initial requests") BalancingHttpClientConfig setRetryBudgetRatio(BigDecimal retryBudgetRatio); @MinDuration("1s") @MaxDuration("60s") Duration getRetryBudgetRatioPeriod(); @Config("http-client.retry-budget.ratio-period") @ConfigDescription("The time over which initial requests are considered when calculating retry budgets") BalancingHttpClientConfig setRetryBudgetRatioPeriod(Duration retryBudgetRatioPeriod); @Min(1) int getRetryBudgetMinPerSecond(); @Config("http-client.retry-budget.min-per-second") @ConfigDescription("Additional number of retries permitted per second") BalancingHttpClientConfig setRetryBudgetMinPerSecond(int retryBudgetMinPerSecond); @AssertFalse boolean isMaxBackoffLessThanMinBackoff(); }
BalancingHttpClientConfig { @Config("http-client.retry-budget.ratio") @ConfigDescription("The ratio of permitted retries to initial requests") public BalancingHttpClientConfig setRetryBudgetRatio(BigDecimal retryBudgetRatio) { this.retryBudgetRatio = retryBudgetRatio; return this; }  @Min(1) int getMaxAttempts(); @Config("http-client.max-attempts") BalancingHttpClientConfig setMaxAttempts(int maxAttempts); Duration getMinBackoff(); @Config("http-client.min-backoff") @ConfigDescription("Minimum backoff delay before a retry") BalancingHttpClientConfig setMinBackoff(Duration minBackoff); Duration getMaxBackoff(); @Config("http-client.max-backoff") @ConfigDescription("Maximum backoff delay before a retry") BalancingHttpClientConfig setMaxBackoff(Duration maxBackoff); @Min(0) @Max(1000) BigDecimal getRetryBudgetRatio(); @Config("http-client.retry-budget.ratio") @ConfigDescription("The ratio of permitted retries to initial requests") BalancingHttpClientConfig setRetryBudgetRatio(BigDecimal retryBudgetRatio); @MinDuration("1s") @MaxDuration("60s") Duration getRetryBudgetRatioPeriod(); @Config("http-client.retry-budget.ratio-period") @ConfigDescription("The time over which initial requests are considered when calculating retry budgets") BalancingHttpClientConfig setRetryBudgetRatioPeriod(Duration retryBudgetRatioPeriod); @Min(1) int getRetryBudgetMinPerSecond(); @Config("http-client.retry-budget.min-per-second") @ConfigDescription("Additional number of retries permitted per second") BalancingHttpClientConfig setRetryBudgetMinPerSecond(int retryBudgetMinPerSecond); @AssertFalse boolean isMaxBackoffLessThanMinBackoff();  }