Codota Logo
RetryTemplate.setThrowLastExceptionOnExhausted
Code IndexAdd Codota to your IDE (free)

How to use
setThrowLastExceptionOnExhausted
method
in
org.springframework.retry.support.RetryTemplate

Best Java code snippets using org.springframework.retry.support.RetryTemplate.setThrowLastExceptionOnExhausted (Showing top 9 results out of 315)

  • Common ways to obtain RetryTemplate
private void myMethod () {
RetryTemplate r =
  • Codota Iconnew RetryTemplate()
  • Codota IconDefaultRetryPolicyFactory.makeRabbitTemplateRetry()
  • Smart code suggestions by Codota
}
origin: org.springframework.cloud/spring-cloud-commons

  private RetryTemplate createRetryTemplate(String serviceName, HttpRequest request, LoadBalancedRetryPolicy retryPolicy) {
    RetryTemplate template = new RetryTemplate();
    BackOffPolicy backOffPolicy = lbRetryFactory.createBackOffPolicy(serviceName);
    template.setBackOffPolicy(backOffPolicy == null ? new NoBackOffPolicy() : backOffPolicy);
    template.setThrowLastExceptionOnExhausted(true);
    RetryListener[] retryListeners = lbRetryFactory.createRetryListeners(serviceName);
    if (retryListeners != null && retryListeners.length != 0) {
      template.setListeners(retryListeners);
    }
    template.setRetryPolicy(
        !lbProperties.isEnabled() || retryPolicy == null ? new NeverRetryPolicy()
            : new InterceptorRetryPolicy(request, retryPolicy, loadBalancer,
            serviceName));
    return template;
  }
}
origin: org.slinkyframework/slinky-environment-builder-couchbase

private void waitFor(BiConsumer<String, CouchbaseBuildDefinition> function, String host, CouchbaseBuildDefinition buildDefinition) {
  TimeoutRetryPolicy retryPolicy = new TimeoutRetryPolicy();
  retryPolicy.setTimeout(THIRTY_SECONDS);
  FixedBackOffPolicy backOffPolicy = new FixedBackOffPolicy();
  backOffPolicy.setBackOffPeriod(ONE_SECOND);
  RetryTemplate retryTemplate = new RetryTemplate();
  retryTemplate.setRetryPolicy(retryPolicy);
  retryTemplate.setThrowLastExceptionOnExhausted(true);
  retryTemplate.setBackOffPolicy(backOffPolicy);
  retryTemplate.execute(rc -> { function.accept(host, buildDefinition); return null; });
}
origin: org.slinkyframework.environment/slinky-common-docker

  public void waitFor(BiConsumer<DockerClient, String> function) {
    TimeoutRetryPolicy retryPolicy = new TimeoutRetryPolicy();
    retryPolicy.setTimeout(THIRTY_SECONDS);

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

    RetryTemplate retryTemplate = new RetryTemplate();
    retryTemplate.setRetryPolicy(retryPolicy);
    retryTemplate.setThrowLastExceptionOnExhausted(true);
    retryTemplate.setBackOffPolicy(backOffPolicy);

    retryTemplate.execute(rc -> { function.accept(dockerClient, containerId); return null; });
  }
}
origin: org.slinkyframework/slinky-environment-builder-couchbase

private void waitFor(BiConsumer<DockerClient, String> function, DockerClient docker, String containerId) {
  TimeoutRetryPolicy retryPolicy = new TimeoutRetryPolicy();
  retryPolicy.setTimeout(THIRTY_SECONDS);
  FixedBackOffPolicy backOffPolicy = new FixedBackOffPolicy();
  backOffPolicy.setBackOffPeriod(ONE_SECOND);
  RetryTemplate retryTemplate = new RetryTemplate();
  retryTemplate.setRetryPolicy(retryPolicy);
  retryTemplate.setThrowLastExceptionOnExhausted(true);
  retryTemplate.setBackOffPolicy(backOffPolicy);
  retryTemplate.execute(rc -> { function.accept(docker, containerId); return null; });
}
origin: org.slinkyframework/slinky-environment-builder-couchbase

private void waitFor(BiConsumer<Bucket, CouchbaseBuildDefinition> function, Bucket bucket, CouchbaseBuildDefinition buildDefinition) {
  TimeoutRetryPolicy retryPolicy = new TimeoutRetryPolicy();
  retryPolicy.setTimeout(THIRTY_SECONDS);
  FixedBackOffPolicy backOffPolicy = new FixedBackOffPolicy();
  backOffPolicy.setBackOffPeriod(ONE_SECOND);
  RetryTemplate retryTemplate = new RetryTemplate();
  retryTemplate.setRetryPolicy(retryPolicy);
  retryTemplate.setThrowLastExceptionOnExhausted(true);
  retryTemplate.setBackOffPolicy(backOffPolicy);
  retryTemplate.execute(rc -> { function.accept(bucket, buildDefinition); return null; });
}
origin: org.slinkyframework.environment/slinky-environment-builder-liquibase

private void waitForSessionsToDie(String username) {
  LOGGER.debug("Waiting for database sessions to die '{}'", username);
  TimeoutRetryPolicy retryPolicy = new TimeoutRetryPolicy();
  retryPolicy.setTimeout(TEN_SECONDS);
  FixedBackOffPolicy backOffPolicy = new FixedBackOffPolicy();
  backOffPolicy.setBackOffPeriod(ONE_SECOND);
  RetryTemplate retryTemplate = new RetryTemplate();
  retryTemplate.setRetryPolicy(retryPolicy);
  retryTemplate.setThrowLastExceptionOnExhausted(true);
  retryTemplate.setBackOffPolicy(backOffPolicy);
  retryTemplate.execute(rc -> { processSessions(username, this::throwExceptionIfSessionExists); return null; });
}
origin: org.slinkyframework.environment/slinky-common-docker

private void waitForContainerToStart() {
  TimeoutRetryPolicy retryPolicy = new TimeoutRetryPolicy();
  retryPolicy.setTimeout(THIRTY_SECONDS);
  FixedBackOffPolicy backOffPolicy = new FixedBackOffPolicy();
  backOffPolicy.setBackOffPeriod(ONE_SECOND);
  RetryTemplate retryTemplate = new RetryTemplate();
  retryTemplate.setRetryPolicy(retryPolicy);
  retryTemplate.setThrowLastExceptionOnExhausted(true);
  retryTemplate.setBackOffPolicy(backOffPolicy);
  retryTemplate.execute(rc -> portInUse(dockerHostname, firstExternalPort()));
}
origin: org.slinkyframework/slinky-environment-builder-couchbase

private void waitForContainerToStart() {
  TimeoutRetryPolicy retryPolicy = new TimeoutRetryPolicy();
  retryPolicy.setTimeout(THIRTY_SECONDS);
  FixedBackOffPolicy backOffPolicy = new FixedBackOffPolicy();
  backOffPolicy.setBackOffPeriod(ONE_SECOND);
  RetryTemplate retryTemplate = new RetryTemplate();
  retryTemplate.setRetryPolicy(retryPolicy);
  retryTemplate.setThrowLastExceptionOnExhausted(true);
  retryTemplate.setBackOffPolicy(backOffPolicy);
  String targetHost = localCouchbaseEnvironmentBuilder.getHosts()[0];
  retryTemplate.execute(rc -> portInUse(targetHost, 8091));
}
origin: spring-cloud/spring-cloud-commons

  private RetryTemplate createRetryTemplate(String serviceName, HttpRequest request, LoadBalancedRetryPolicy retryPolicy) {
    RetryTemplate template = new RetryTemplate();
    BackOffPolicy backOffPolicy = lbRetryFactory.createBackOffPolicy(serviceName);
    template.setBackOffPolicy(backOffPolicy == null ? new NoBackOffPolicy() : backOffPolicy);
    template.setThrowLastExceptionOnExhausted(true);
    RetryListener[] retryListeners = lbRetryFactory.createRetryListeners(serviceName);
    if (retryListeners != null && retryListeners.length != 0) {
      template.setListeners(retryListeners);
    }
    template.setRetryPolicy(
        !lbProperties.isEnabled() || retryPolicy == null ? new NeverRetryPolicy()
            : new InterceptorRetryPolicy(request, retryPolicy, loadBalancer,
            serviceName));
    return template;
  }
}
org.springframework.retry.supportRetryTemplatesetThrowLastExceptionOnExhausted

Popular methods of RetryTemplate

  • <init>
  • setRetryPolicy
    Setter for RetryPolicy.
  • setBackOffPolicy
    Setter for BackOffPolicy.
  • execute
    Execute the callback once if the policy dictates that we can, re-throwing any exception encountered
  • registerListener
    Register an additional listener.
  • setListeners
    Setter for listeners. The listeners are executed before and after a retry block (i.e. before and aft
  • setRetryContextCache
    Public setter for the RetryContextCache.
  • canRetry
    Decide whether to proceed with the ongoing retry attempt. This method is called before the RetryCall
  • close
    Clean up the cache if necessary and close the context provided (if the flag indicates that processin
  • handleRetryExhausted
    Actions to take after final attempt has failed. If there is state clean up the cache. If there is a
  • open
    Delegate to the RetryPolicy having checked in the cache for an existing value if the state is not nu
  • registerThrowable
  • open,
  • registerThrowable,
  • doCloseInterceptors,
  • doExecute,
  • doOnErrorInterceptors,
  • doOpenInterceptors,
  • doOpenInternal,
  • registerContext,
  • rethrow

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • addToBackStack (FragmentTransaction)
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now