Questions tagged [spring-retry]

Spring Retry provides an abstraction around retrying failed operations, with an emphasis on declarative control of the process and policy-based behaviour that is easy to extend and customize.

The Spring Retry project is refactored from Spring Batch's support for retrying operations as of Spring Batch 2.2.0. It is used in several Spring projects.

See also

469 questions
0
votes
2 answers

Spring-Retry doesn't get a new database connection from HikariCP

I know that spring-retry doesn't grab database connections. We've wrapped a REST endpoint with @Retryable in an attempt to enact retry functionality but its not quite working as expected. I had anticipated that when a SQLException is thrown due to a…
0
votes
1 answer

How to throw exception from Spring AOP declarative retry methods?

I'm implementing some retry handling in my methods using Spring Retry. I have a Data Access Layer (DAL) in my application and a Service Layer in my application. My Service layer calls the DAL to make a remote connection to retrieve information. If…
alex
  • 1,905
  • 26
  • 51
0
votes
2 answers

Delay SpringBoot application startup until db is up

I have a SpringBoot application that will fail to start up when the database it is using is not up since the datasource bean will fail to initialize. I want for my application to not start before my db is up in order to avoid this failure. To…
dragosb
  • 607
  • 8
  • 25
0
votes
1 answer

How to increase Atomikos default jta timeout based on the thread during Spring retry

I am using Spring boot application with Atomikos transactions. I have configured default time out as 10000ms which is 10sec in the transactions properties. transactions…
KSK
  • 636
  • 1
  • 9
  • 29
0
votes
1 answer

Spring Retry with for loop

My RetryTemplate config: @Configuration @EnableRetry public class RetryTemplateConfig { @Value("${spring.retry.attempts}") private int maxAttempts; @Value("${spring.retry.period}") private long backOffPeriod; @Bean public…
takotsubo
  • 666
  • 6
  • 18
0
votes
1 answer

spring retry with custom boolean value from the request

I am newbie in spring annotations and spring retry. Below is the sample code, my query is based on the method argument isRetryNeeded, I need to decide if a retry(here 3 times) is needed or not. Thank you package com.example.retry; import…
Teja
  • 69
  • 7
0
votes
1 answer

How can we get the JobId in the RetryContext?

I am just extending my this question here - Spring Retry doesn't works when we use RetryTemplate?. How can we get the JobId in the RetryContext ? I went through link: Spring Batch how to configure retry period for failed jobs, but still did not…
PAA
  • 1
  • 46
  • 174
  • 282
0
votes
1 answer

How to change the spring retry template fixed back off policy based on the exception

I am using Spring Retry Template for retrying. This is my method for retry, here my retry interval should be based on the Exception. For example if DataException thrown, retry should happen for 1000(1 sec) time interval or if MQException thrown,…
KSK
  • 636
  • 1
  • 9
  • 29
0
votes
1 answer

Spring Boot @Retryable maxAttempts according to exception

I wonder something about Spring Boot @Retryable annotation. I want to implement @Retryable maxAttemps count according to Exception type, like: if Exception type is ExceptionA: @Retryable(value = ExceptionA.class, maxAttempts = 2) if Exception type…
Sha
  • 921
  • 17
  • 46
0
votes
1 answer

Spring Cloud Stream disable retry

I'm using Spring cloud stream with spring cloud function with reactive approach. My binder is RabbitMQ. By definition maxAttempts property is the number of times that a message can be processed (that's what I interpret) From:…
0
votes
1 answer

Spring Cloud Stream and Spring RetryTemplate handling of nested exception

I have a Spring Cloud Stream project using the Kafka binder and I want to add retry functionality, I am trying to use RetryTemplate and specify certain exceptions that I want to handle, but because of any exception is wrapped by…
0
votes
1 answer

java 8 Springboot How to use properties from application.yml file in annotations?

I am using java 8, Spring boot 2.2 and have a piece of code where I use `@Retryable`. The backoff, maxattempt fields as of now are hardcoded and I wish to make them configurable. But only constants are allowed in there; have to be final. Any idea…
0
votes
0 answers

Method annotated with @Retryable not getting invoked when called from batch process method

Method annotated with @Retryable not getting invoked when called from batch process method. @Service public class HierarchyRetryOperationImpl implements HierarchyRetryOperation { private final HierarchyService hierarchyService; @Inject …
0
votes
1 answer

SimpleRetryPolicy Spring

I am browsing in the docs and can see that there is functions that would be really useful, however going further I realized that they not existing anymore or I am wrong? I would like to perform a business logic based on exception type -> or in more…
0
votes
1 answer

Spring Retry Circuit breaker opening for all exceptions

I was trying to use Spring Retry Circuit Breaker. My requirement is to open the Circuit only for repetitive exceptions of a specific type. And for all other exceptions, I would like to pass the exception back to the caller without opening the…
Jagan
  • 3
  • 3