@Test public void headerHasPriority() { RetryAttempt retry = new RetryAttempt(new HttpException(errorResponse(429, 10)), 1, DEFAULT); Assertions.assertThat(retry.getRetryInterval()).isEqualTo(10000L); retry = new RetryAttempt(new HttpException(errorResponse(429)), 1, DEFAULT); Assertions.assertThat(retry.getRetryInterval()).isEqualTo(5000L); }
long getRetryInterval() { long retryInterval; String retryAfter = getRetryAfter(); if (retryAfter != null) { retryInterval = TimeUnit.MILLISECONDS.convert(Integer.parseInt(retryAfter), TimeUnit.SECONDS); } else { retryInterval = writeOptions.getRetryInterval() * (long) (Math.pow(writeOptions.getExponentialBase(), count - 1)); retryInterval = Math.min(retryInterval, writeOptions.getMaxRetryDelay()); String msg = "The InfluxDB does not specify \"Retry-After\". Use the default retryInterval: {0}"; LOG.log(Level.FINEST, msg, retryInterval); } retryInterval = retryInterval + jitterDelay(writeOptions.getJitterInterval()); return retryInterval; }
RetryAttempt { long getRetryInterval() { long retryInterval; String retryAfter = getRetryAfter(); if (retryAfter != null) { retryInterval = TimeUnit.MILLISECONDS.convert(Integer.parseInt(retryAfter), TimeUnit.SECONDS); } else { retryInterval = writeOptions.getRetryInterval() * (long) (Math.pow(writeOptions.getExponentialBase(), count - 1)); retryInterval = Math.min(retryInterval, writeOptions.getMaxRetryDelay()); String msg = "The InfluxDB does not specify \"Retry-After\". Use the default retryInterval: {0}"; LOG.log(Level.FINEST, msg, retryInterval); } retryInterval = retryInterval + jitterDelay(writeOptions.getJitterInterval()); return retryInterval; } }
RetryAttempt { long getRetryInterval() { long retryInterval; String retryAfter = getRetryAfter(); if (retryAfter != null) { retryInterval = TimeUnit.MILLISECONDS.convert(Integer.parseInt(retryAfter), TimeUnit.SECONDS); } else { retryInterval = writeOptions.getRetryInterval() * (long) (Math.pow(writeOptions.getExponentialBase(), count - 1)); retryInterval = Math.min(retryInterval, writeOptions.getMaxRetryDelay()); String msg = "The InfluxDB does not specify \"Retry-After\". Use the default retryInterval: {0}"; LOG.log(Level.FINEST, msg, retryInterval); } retryInterval = retryInterval + jitterDelay(writeOptions.getJitterInterval()); return retryInterval; } RetryAttempt(final Throwable throwable, final int count, final WriteOptions writeOptions); }
RetryAttempt { long getRetryInterval() { long retryInterval; String retryAfter = getRetryAfter(); if (retryAfter != null) { retryInterval = TimeUnit.MILLISECONDS.convert(Integer.parseInt(retryAfter), TimeUnit.SECONDS); } else { retryInterval = writeOptions.getRetryInterval() * (long) (Math.pow(writeOptions.getExponentialBase(), count - 1)); retryInterval = Math.min(retryInterval, writeOptions.getMaxRetryDelay()); String msg = "The InfluxDB does not specify \"Retry-After\". Use the default retryInterval: {0}"; LOG.log(Level.FINEST, msg, retryInterval); } retryInterval = retryInterval + jitterDelay(writeOptions.getJitterInterval()); return retryInterval; } RetryAttempt(final Throwable throwable, final int count, final WriteOptions writeOptions);  }
RetryAttempt { long getRetryInterval() { long retryInterval; String retryAfter = getRetryAfter(); if (retryAfter != null) { retryInterval = TimeUnit.MILLISECONDS.convert(Integer.parseInt(retryAfter), TimeUnit.SECONDS); } else { retryInterval = writeOptions.getRetryInterval() * (long) (Math.pow(writeOptions.getExponentialBase(), count - 1)); retryInterval = Math.min(retryInterval, writeOptions.getMaxRetryDelay()); String msg = "The InfluxDB does not specify \"Retry-After\". Use the default retryInterval: {0}"; LOG.log(Level.FINEST, msg, retryInterval); } retryInterval = retryInterval + jitterDelay(writeOptions.getJitterInterval()); return retryInterval; } RetryAttempt(final Throwable throwable, final int count, final WriteOptions writeOptions);   }