use of org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy in project camel by apache.
the class OptimisticLockRetryPolicyTest method testRandomBackOff.
public void testRandomBackOff() throws Exception {
OptimisticLockRetryPolicy policy = new OptimisticLockRetryPolicy();
policy.setRandomBackOff(true);
policy.setExponentialBackOff(false);
policy.setMaximumRetryDelay(500L);
for (int i = 0; i < 10; i++) {
long elapsed = doDelay(policy, i);
assertTrue(elapsed <= policy.getMaximumRetryDelay() + precision && elapsed >= 0);
}
}
Aggregations