Examples of FixedBackOffPolicy


Examples of org.springframework.retry.backoff.FixedBackOffPolicy

      if (sleeper != null) {
        policy.setSleeper(sleeper);
      }
      return policy;
    }
    FixedBackOffPolicy policy = new FixedBackOffPolicy();
    policy.setBackOffPeriod(min);
    if (sleeper != null) {
      policy.setSleeper(sleeper);
    }
    return policy;
  }
View Full Code Here

Examples of org.springframework.retry.backoff.FixedBackOffPolicy

  @Test
  public void testSimulatorExercisesFixedBackoff() {
    SimpleRetryPolicy retryPolicy = new SimpleRetryPolicy();
    retryPolicy.setMaxAttempts(5);

    FixedBackOffPolicy backOffPolicy = new FixedBackOffPolicy();
    backOffPolicy.setBackOffPeriod(400);

    RetrySimulator simulator = new RetrySimulator(backOffPolicy, retryPolicy);
    RetrySimulation simulation = simulator.executeSimulation(1000);
    System.out.println(backOffPolicy);
    System.out.println("Longest sequence  " + simulation.getLongestTotalSleepSequence());
View Full Code Here

Examples of org.springframework.retry.backoff.FixedBackOffPolicy

  @Test
  public void testWithCustomBackOffPolicy() {
    StatefulRetryOperationsInterceptor interceptor =
        RetryInterceptorBuilder.stateful()
          .maxAttempts(5)
          .backOffPolicy(new FixedBackOffPolicy())
          .build();

    assertEquals(5, TestUtils.getPropertyValue(interceptor, "retryOperations.retryPolicy.maxAttempts"));
    assertEquals(1000L, TestUtils.getPropertyValue(interceptor, "retryOperations.backOffPolicy.backOffPeriod"));
  }
View Full Code Here

Examples of org.springframework.retry.backoff.FixedBackOffPolicy

            public boolean isNew(Object[] args) {
              latch.countDown();
              return false;
            }
          })
          .backOffPolicy(new FixedBackOffPolicy())
          .build();

    assertEquals(5, TestUtils.getPropertyValue(interceptor, "retryOperations.retryPolicy.maxAttempts"));
    assertEquals(1000L, TestUtils.getPropertyValue(interceptor, "retryOperations.backOffPolicy.backOffPeriod"));
    final AtomicInteger count = new AtomicInteger();
View Full Code Here

Examples of org.springframework.retry.backoff.FixedBackOffPolicy

  @Test
  public void testWithCustomBackOffPolicy() {
    StatefulRetryOperationsInterceptor interceptor =
        RetryInterceptorBuilder.stateful()
          .maxAttempts(5)
          .backOffPolicy(new FixedBackOffPolicy())
          .build();

    assertEquals(5, TestUtils.getPropertyValue(interceptor, "retryOperations.retryPolicy.maxAttempts"));
    assertEquals(1000L, TestUtils.getPropertyValue(interceptor, "retryOperations.backOffPolicy.backOffPeriod"));
  }
View Full Code Here

Examples of org.springframework.retry.backoff.FixedBackOffPolicy

              public boolean isNew(Message message) {
                latch.countDown();
                return false;
              }
            })
          .backOffPolicy(new FixedBackOffPolicy())
          .build();

    assertEquals(5, TestUtils.getPropertyValue(interceptor, "retryOperations.retryPolicy.maxAttempts"));
    assertEquals(1000L, TestUtils.getPropertyValue(interceptor, "retryOperations.backOffPolicy.backOffPeriod"));
    final AtomicInteger count = new AtomicInteger();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.