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
1 answer

Create Retry template to retry on Connection timeout and read timeout

I have integrated a rest template within my spring boot application. The rest template successfully establishes connection and read timeouts. I have also integrated a retry template to retry on these connection and read timeouts. The code for my…
0
votes
1 answer

Sending message to DLQ when Exception is not Retriable

I'm using Spring Cloud Streams and the default Spring Retry mechanism only by using properties. I currently have an application which retries correctly (up to the max retries) when MyCustomException is thrown in my listener. Then, it is sent to the…
elbars0
  • 37
  • 5
0
votes
1 answer

Executing custom retry policy with retry template

I have a custom retry policy that is designed to perform retries whenever the application receives http status codes that are not 404. I also have created a retry template. I am stuck on how I am to execute the custom retry policy with the retry…
Dave Michaels
  • 847
  • 1
  • 19
  • 51
0
votes
1 answer

need to use SimpleRetryPolicy and TimeoutRetryPolicy together so i can set max-attempt and timeout both for a retrytemplate

need to use SimpleRetryPolicy and TimeoutRetryPolicy together so i can set max-attempt and timeout both for a retrytemplate @Bean @Qualifier(value = "MyRetryBean") public RetryTemplate grafanaRetryTemplate() { RetryTemplate retryTemplate = new…
Satyajeet
  • 15
  • 6
0
votes
1 answer

Spring retry for DAO call with XML configuration

I have a method which invokes a DAO call something like this @Overide public List methodGetList (Parameter) { List myList = listDao.getList() } I want to retry if the dao layer throws SQL Exception. Where should the @Retryable annotation should be…
0
votes
1 answer

Spring-retry restarts after maxAttempts reached when no recover method is provided

Playing with spring-retry with spring-boot 1.5.21 and noticing that spring-retry restarts when maxAttempts is reached when there is no recover method implemented. Works as expected if proper recover method is implemented. If no recover method, retry…
Stego
  • 87
  • 1
  • 11
0
votes
1 answer

Spring @Retryable with configurable delay based on client

I am developing a Spring boot application. From my application we are calling an external RestService and want to retry if RestCall fails for any reason. I know that @Retryable within spring should take care of this. I am trying to implement…
ging
  • 219
  • 7
  • 20
0
votes
1 answer

Spring-Retry circuit breaker moves to recover code, without any retry attempt in case of exception

I am using the spring-retry library for my spring boot application. When using @CircuitBreaker(include = { Exception.class }, maxAttempts = 2) annotation in case of exception the method moves to recover block, without any retry attempt. Please find…
Vijay k
  • 5
  • 7
0
votes
1 answer

How to retry if web services are down?

I tried to retry when the web service failed. I was using spring retry, but with spring retry I can't specify the status code based retry This is my code @retryable(value=Exception.class,maxAttampts=2) Public void retry() throws exception { …
tisispa1
  • 203
  • 2
  • 3
  • 16
0
votes
3 answers

@Retryable is calling multiple times even if there is no exception occured

I have used spring @Retryable to implement retry function call if there is any problems occurs when calling another service using RestTemplate. The function is given below, the problem is that I have given maxAttempts to 4 in case of any exception…
Alex Man
  • 4,746
  • 17
  • 93
  • 178
0
votes
2 answers

Kafka stream does not retry on deserialisation error

Spring cloud Kafka stream does not retry upon deserialization error even after specific configuration. The expectation is, it should retry based on the configured retry policy and at the end push the failed message to DLQ. Configuration as…
0
votes
1 answer

Using Spring @Retryable with Jackson json deserialization

I'm trying to use Spring Retry for Jackson deserialization into a POJO object like so: @Data public class myPOJO { private String cmpStr = "test"; private String myStr; @Retryable(maxAttempts=3, value=RuntimeException.class,…
davo
  • 35
  • 4
0
votes
1 answer

How can I execute recovery logic on every attempt using spring RetryTemplate

I have a spring RetryTemplate wrapping a set of http calls to a DB wrapping service, which when combined have all a transactional nature, meaning that if the last one fails, I need to rollback all previously executed operations, and start the…
omer keynan
  • 135
  • 1
  • 11
0
votes
2 answers

Implement fault tolerance in Spring Batch

I have following batch job implemented in Spring Batch config: @Bean public Job myJob(Step step1, Step step2, Step step3) { return jobs.get("myJob").start(step1).next(step2).next(step3).build(); } @Bean public Step step1(ItemReader
adesai
  • 370
  • 3
  • 22
0
votes
1 answer

SpringBoot OAuth2RestTemplate retry requests

We are in the need of adding retries when making calls to an API that has Oauth2 from Spring. We haven't figured out how to do it in an easy way. We even tried with an interceptor but we have no luck. Here's our…